Skip to content

Commit

Permalink
[GH #808] Remove sleep calls in nci.t, because of signal deadlocks wi…
Browse files Browse the repository at this point in the history
…th parrot threads

Even without sleep calls the tests succeed. But since it loops until the resuilt arrives, let
it busy loop a bit longer.
Note: This is a hack. sleep on threads should be fixed instead.
  • Loading branch information
Reini Urban committed Aug 10, 2012
1 parent 57cee73 commit 56c96dd
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions t/pmc/nci.t
Expand Up @@ -1332,11 +1332,11 @@ OUTPUT
set I20, 0
loop:
inc I20
# Avoid sleep deadlock in threads branch [GH #808]
# Avoid sleep deadlocks in threads branch [GH #808]
# sleep 0.01
get_global P11, "cb_done"
if P11, fin
gt I20, 10, err
gt I20, 10000, err
branch loop
fin:
print "done.\n"
Expand Down Expand Up @@ -1403,11 +1403,10 @@ OUTPUT
sleep_cnt = 0
LOOP:
sleep_cnt += 1
sleep 0.01
.local pmc callback_has_run
callback_has_run = get_global "cb_done"
if callback_has_run goto FINISHED
if sleep_cnt > 10 goto ERROR
if sleep_cnt > 10000 goto ERROR
goto LOOP
FINISHED:
print "the callback has run\n"
Expand Down Expand Up @@ -1466,10 +1465,10 @@ OUTPUT
set I20, 0
loop:
inc I20
sleep 0.01
#sleep 0.01
get_global P11, "cb_done"
if P11, fin
gt I20, 10, err
gt I20, 10000, err
branch loop
fin:
print "done.\n"
Expand Down Expand Up @@ -1540,11 +1539,11 @@ OUTPUT
sleep_cnt = 0
LOOP:
sleep_cnt += 1
sleep 0.01
#sleep 0.01
.local pmc callback_has_run
callback_has_run = get_global "cb_done"
if callback_has_run goto FINISHED
if sleep_cnt > 10 goto ERROR
if sleep_cnt > 10000 goto ERROR
goto LOOP
FINISHED:
print "the callback has run\n"
Expand Down Expand Up @@ -1614,10 +1613,10 @@ OUTPUT
set I20, 0
loop:
inc I20
sleep 0.01
#sleep 0.01
get_global P11, "cb_done"
if P11, fin
gt I20, 10, err
gt I20, 10000, err
branch loop
fin:
print "done.\n"
Expand Down Expand Up @@ -1673,10 +1672,10 @@ OUTPUT
set I20, 0
loop:
inc I20
sleep 0.01
#sleep 0.01
get_global P11, "cb_done"
if P11, fin
gt I20, 10, err
gt I20, 10000, err
branch loop
fin:
print "done.\n"
Expand Down Expand Up @@ -1744,11 +1743,11 @@ OUTPUT
sleep_cnt = 0
LOOP:
sleep_cnt += 1
sleep 0.01
#sleep 0.01
.local pmc callback_has_run
callback_has_run = get_global "cb_done"
if callback_has_run goto FINISHED
if sleep_cnt > 10 goto ERROR
if sleep_cnt > 10000 goto ERROR
goto LOOP
FINISHED:
print "the callback has run\n"
Expand Down Expand Up @@ -1821,11 +1820,11 @@ OUTPUT
sleep_cnt = 0
LOOP:
sleep_cnt += 1
sleep 0.01
#sleep 0.01
.local pmc callback_has_run
callback_has_run = get_global "cb_done"
if callback_has_run goto FINISHED
if sleep_cnt > 10 goto ERROR
if sleep_cnt > 10000 goto ERROR
goto LOOP
FINISHED:
print "the callback has run\n"
Expand Down

0 comments on commit 56c96dd

Please sign in to comment.