1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-12-24 17:51:17 +03:00
* spinlock.h (__pthread_trylock): Use __compare_and_swap, not
	compare_and_swap.
This commit is contained in:
Ulrich Drepper
2000-07-19 05:36:15 +00:00
parent 247c88694b
commit a48297fdf3
5 changed files with 46417 additions and 4 deletions

View File

@@ -1,5 +1,8 @@
2000-07-18 Ulrich Drepper <drepper@redhat.com>
* spinlock.h (__pthread_trylock): Use __compare_and_swap, not
compare_and_swap.
* pthread.c (pthread_initialize): Don't use syscond to determine
whether the machine has more than one processor.

View File

@@ -22,7 +22,7 @@
semantics (it completes after previous writes.)
For those platforms on which they are the same. HAS_COMPARE_AND_SWAP
should be defined. For those platforms on which they are different,
should be defined. For those platforms on which they are different,
HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS has to be defined. */
#ifndef HAS_COMPARE_AND_SWAP
@@ -115,12 +115,12 @@ static inline int __pthread_trylock (struct _pthread_fastlock * lock)
do {
oldstatus = lock->__status;
if (oldstatus != 0) return EBUSY;
} while(! compare_and_swap(&lock->__status, 0, 1, &lock->__spinlock));
} while(! __compare_and_swap(&lock->__status, 0, 1));
return 0;
#endif
}
/* Variation of internal lock used for pthread_mutex_t, supporting
/* Variation of internal lock used for pthread_mutex_t, supporting
timed-out waits. Warning: do not mix these operations with the above ones
over the same lock object! */