mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-30 08:18:30 +00:00
Write some lock contention tests
This commit is contained in:
parent
42c38bc3e3
commit
c06ffd458c
19 changed files with 205 additions and 76 deletions
|
@ -29,7 +29,7 @@ int pthread_mutex_trylock(pthread_mutex_t *mutex) {
|
|||
int rc, me, owner;
|
||||
me = gettid();
|
||||
owner = 0;
|
||||
if (!atomic_compare_exchange_strong(&mutex->owner, &owner, me) &&
|
||||
if (!atomic_compare_exchange_strong(&mutex->lock, &owner, me) &&
|
||||
owner == me) {
|
||||
rc = 0;
|
||||
++mutex->reent;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue