mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
Added pthread_testcancel() in ib_read()
As discussed in issue #186 and on IM. This function check every 2048th cycle if the thread should be canceled. This also removed the need for 'kill -9' in the integration test.
This commit is contained in:
parent
918a077245
commit
b96a55237b
2 changed files with 5 additions and 3 deletions
|
@ -723,7 +723,9 @@ int ib_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *relea
|
|||
// Poll Completion Queue
|
||||
// If we've already posted enough receive WRs, try to pull cnt
|
||||
if (ib->conn.available_recv_wrs >= (ib->qp_init.cap.max_recv_wr - ib->conn.buffer_subtraction) ) {
|
||||
while(1) {
|
||||
for (int i = 0;; i++) {
|
||||
if (i % 2048 == 2047) pthread_testcancel();
|
||||
|
||||
if (n->state != STATE_CONNECTED) return 0;
|
||||
|
||||
wcs = ibv_poll_cq(ib->ctx.recv_cq, cnt, wc);
|
||||
|
|
|
@ -166,8 +166,8 @@ do
|
|||
sleep 2
|
||||
|
||||
# Stop node
|
||||
kill -9 $node_pipe
|
||||
kill -9 $node_proc
|
||||
kill $node_pipe
|
||||
kill $node_proc
|
||||
|
||||
# Compare data
|
||||
villas-test-cmp ${INPUT_FILE} ${OUTPUT_FILE}
|
||||
|
|
Loading…
Add table
Reference in a new issue