diff options
Diffstat (limited to 'tests/spin3.c')
-rw-r--r-- | tests/spin3.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/spin3.c b/tests/spin3.c index fa16b35..bbf8bfb 100644 --- a/tests/spin3.c +++ b/tests/spin3.c @@ -64,7 +64,11 @@ main() assert(pthread_spin_lock(&spin) == 0); assert(pthread_create(&t, NULL, unlocker, (void*)0) == 0); assert(pthread_join(t, NULL) == 0); - assert(pthread_spin_unlock(&spin) == EPERM); + /* + * Our spinlocks don't record the owner thread so any thread can unlock the spinlock, + * but nor is it an error for any thread to unlock a spinlock that is not locked. + */ + assert(pthread_spin_unlock(&spin) == 0); assert(pthread_spin_destroy(&spin) == 0); assert(wasHere == 2); |