diff options
author | Marco S Hyman <marc@cvs.openbsd.org> | 2002-02-17 05:44:39 +0000 |
---|---|---|
committer | Marco S Hyman <marc@cvs.openbsd.org> | 2002-02-17 05:44:39 +0000 |
commit | e7dfaead07ecdc314999e4f913d86405f2245ab8 (patch) | |
tree | 345c51ab3ca6ee70e4828ab357005a6946d44e05 /regress/lib/libpthread | |
parent | 6e7c01afd33f3207ec5849170599032a7c97b339 (diff) |
use semaphore to sync threads, not sleep
Diffstat (limited to 'regress/lib/libpthread')
-rw-r--r-- | regress/lib/libpthread/cancel/cancel.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/regress/lib/libpthread/cancel/cancel.c b/regress/lib/libpthread/cancel/cancel.c index 6f9359246d2..4c70a229bcd 100644 --- a/regress/lib/libpthread/cancel/cancel.c +++ b/regress/lib/libpthread/cancel/cancel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cancel.c,v 1.4 2002/02/17 04:33:33 marc Exp $ */ +/* $OpenBSD: cancel.c,v 1.5 2002/02/17 05:44:38 marc Exp $ */ /* David Leonard <d@openbsd.org>, 1999. Public Domain. */ #include <pthread.h> @@ -111,6 +111,7 @@ child2fn(arg) message_seen++; c2_in_test = 0; ASSERT(message_seen == 1); + v(); } PANIC("child 2"); } @@ -162,7 +163,7 @@ main() p(); /* Give thread 2 a chance to go through its deferred loop once */ - sleep(2); + p(); CHECKr(pthread_cancel(child2)); p(); |