version 1.20, 2007/03/24 18:52:00 |
version 1.20.2.1, 2007/07/18 13:36:19 |
Line 77 pthread__simple_lock_init(__cpu_simple_l |
|
Line 77 pthread__simple_lock_init(__cpu_simple_l |
|
return; |
return; |
} |
} |
|
|
*alp = __SIMPLELOCK_UNLOCKED; |
__cpu_simple_lock_clear(alp); |
} |
} |
|
|
int |
int |
pthread__simple_lock_try(__cpu_simple_lock_t *alp) |
pthread__simple_lock_try(__cpu_simple_lock_t *alp) |
{ |
{ |
__cpu_simple_lock_t old; |
__cpu_simple_lock_t old; |
|
__cpu_simple_lock_t locked = __SIMPLELOCK_LOCKED; |
|
|
if (pthread__atomic) |
if (pthread__atomic) |
return __cpu_simple_lock_try(alp); |
return __cpu_simple_lock_try(alp); |
|
|
RAS_START(pthread__lock); |
RAS_START(pthread__lock); |
old = *alp; |
old = *alp; |
*alp = __SIMPLELOCK_LOCKED; |
*alp = locked; |
RAS_END(pthread__lock); |
RAS_END(pthread__lock); |
|
|
return old == __SIMPLELOCK_UNLOCKED; |
return __SIMPLELOCK_UNLOCKED_P(&old); |
} |
} |
|
|
inline void |
inline void |
Line 105 pthread__simple_unlock(__cpu_simple_lock |
|
Line 106 pthread__simple_unlock(__cpu_simple_lock |
|
return; |
return; |
} |
} |
|
|
*alp = __SIMPLELOCK_UNLOCKED; |
__cpu_simple_lock_clear(alp); |
} |
} |
|
|
/* |
/* |
Line 241 pthread_spin_destroy(pthread_spinlock_t |
|
Line 242 pthread_spin_destroy(pthread_spinlock_t |
|
#ifdef ERRORCHECK |
#ifdef ERRORCHECK |
if (lock == NULL || lock->pts_magic != _PT_SPINLOCK_MAGIC) |
if (lock == NULL || lock->pts_magic != _PT_SPINLOCK_MAGIC) |
return EINVAL; |
return EINVAL; |
if (lock->pts_spin != __SIMPLELOCK_UNLOCKED) |
if (!__SIMPLELOCK_UNLOCKED_P(&lock->pts_spin)) |
return EBUSY; |
return EBUSY; |
#endif |
#endif |
|
|