1 | *** POSIX SPINLOCK TEST 01 *** |
---|
2 | pthread_spin_init( NULL, PTHREAD_PROCESS_PRIVATE ) -- EINVAL |
---|
3 | pthread_spin_init( NULL, PTHREAD_PROCESS_SHARED ) -- EINVAL |
---|
4 | pthread_spin_init( &spinlock, 0x1234 ) -- EINVAL |
---|
5 | pthread_spin_init( &spinlock, PTHREAD_PROCESS_SHARED ) -- EINVAL |
---|
6 | pthread_spin_init( &Spinlock, PTHREAD_PROCESS_PRIVATE ) -- OK |
---|
7 | pthread_spin_init( &spinlock, PTHREAD_PROCESS_PRIVATE ) -- EAGAIN |
---|
8 | pthread_spin_init( &spinlock, PTHREAD_PROCESS_PRIVATE ) -- EAGAIN |
---|
9 | pthread_spin_lock( NULL ) -- EINVAL |
---|
10 | pthread_spin_trylock( NULL ) -- EINVAL |
---|
11 | pthread_spin_unlock( NULL ) -- EINVAL |
---|
12 | pthread_spin_destroy( NULL ) -- EINVAL |
---|
13 | pthread_spin_lock( &spinlock ) -- EINVAL |
---|
14 | pthread_spin_trylock( &spinlock ) -- EINVAL |
---|
15 | pthread_spin_unlock( &spinlock ) -- EINVAL |
---|
16 | pthread_spin_destroy( &spinlock ) -- EINVAL |
---|
17 | pthread_spin_unlock( &Spinlock ) -- already unlocked OK |
---|
18 | pthread_spin_lock( &Spinlock ) -- OK |
---|
19 | pthread_spin_lock( &Spinlock ) -- EDEADLK |
---|
20 | pthread_spin_trylock( &Spinlock ) -- EDEADLK |
---|
21 | pthread_spin_unlock( &Spinlock ) -- OK |
---|
22 | pthread_spin_trylock( &Spinlock ) -- OK |
---|
23 | pthread_spin_unlock( &Spinlock ) -- OK |
---|
24 | pthread_spin_lock( &Spinlock ) from Thread -- OK |
---|
25 | sleep to allow main thread to run |
---|
26 | pthread_spin_lock( &Spinlock ) -- OK |
---|
27 | pthread_spin_unlock( &Spinlock ) from Thread -- OK |
---|
28 | pthread_spin_destroy( &Spinlock ) -- EBUSY |
---|
29 | pthread_spin_unlock( &Spinlock ) -- OK |
---|
30 | pthread_spin_destroy( &Spinlock ) -- OK |
---|
31 | *** END OF POSIX SPINLOCK TEST 01 *** |
---|