#include #include #include "thread_internal.h" void __pthread_lock(struct _pthread_fastlock*lock) { int cnt=0; struct timespec tm; while (__testandset(&lock->__spinlock)) { if (cnt__spinlock); } int __pthread_unlock(struct _pthread_fastlock*lock) { lock->__spinlock=PTHREAD_SPIN_UNLOCKED; return 0; }