diff options
author | 2005-12-19 05:22:57 +0000 | |
---|---|---|
committer | 2005-12-19 05:22:57 +0000 | |
commit | 308936c60926c83fd0d04c15930f58acf8774352 (patch) | |
tree | 9fc44be91d2df55f8165459fe841ffcda66ce9b6 /regress/lib/libpthread/pthread_mutex/pthread_mutex.c | |
parent | sanity check for key_delete was missing ! (diff) | |
download | wireguard-openbsd-308936c60926c83fd0d04c15930f58acf8774352.tar.xz wireguard-openbsd-308936c60926c83fd0d04c15930f58acf8774352.zip |
after mutex_unlock, there's no guarantee that a waiting thread will
start running. calling pthread_yield makes test pass with rthreads
Diffstat (limited to 'regress/lib/libpthread/pthread_mutex/pthread_mutex.c')
-rw-r--r-- | regress/lib/libpthread/pthread_mutex/pthread_mutex.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/regress/lib/libpthread/pthread_mutex/pthread_mutex.c b/regress/lib/libpthread/pthread_mutex/pthread_mutex.c index 98121236acc..8804cba8755 100644 --- a/regress/lib/libpthread/pthread_mutex/pthread_mutex.c +++ b/regress/lib/libpthread/pthread_mutex/pthread_mutex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pthread_mutex.c,v 1.5 2005/10/30 23:59:43 fgsch Exp $ */ +/* $OpenBSD: pthread_mutex.c,v 1.6 2005/12/19 05:22:57 tedu Exp $ */ /* * Copyright (c) 1993, 1994, 1995, 1996 by Chris Provenzano and contributors, * proven@mit.edu All rights reserved. @@ -75,6 +75,7 @@ test_contention_lock(pthread_mutex_t *mutex) pthread_yield(); contention_variable = 1; CHECKr(pthread_mutex_unlock(mutex)); + pthread_yield(); CHECKr(pthread_mutex_lock(mutex)); ASSERT(contention_variable == 2); CHECKr(pthread_mutex_unlock(mutex)); |