1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- #include "pthread.h"
- #include "implement.h"
- int
- pte_spinlock_check_need_init (pthread_spinlock_t * lock)
- {
- int result = 0;
-
- pte_osMutexLock (pte_spinlock_test_init_lock);
-
- if (*lock == PTHREAD_SPINLOCK_INITIALIZER)
- {
- result = pthread_spin_init (lock, PTHREAD_PROCESS_PRIVATE);
- }
- else if (*lock == NULL)
- {
-
- result = EINVAL;
- }
- pte_osMutexUnlock(pte_spinlock_test_init_lock);
- return (result);
- }
|