Searched refs:semaphore (Results 1 - 5 of 5) sorted by relevance

/system/extras/tests/bionic/libc/common/
H A Dtest_semaphore.c29 #include <semaphore.h>
36 /* a simple semaphore test, using three threads
38 * a semaphore is initialized with a value of 1
42 * Thread 1 takes the semaphore, then sleeps for 2 seconds, then post the semaphore
43 * Thread 2 sleeps for 1 second, then waits the semaphore, sleeps for 2 seconds, then post the semaphoe
44 * Thread 3 sleeps 3 seconds, waits for the semaphore
47 static sem_t semaphore; variable
52 printf( "thread 1: waiting for semaphore\n" );
53 if ( sem_wait( &semaphore ) <
[all...]
H A Dtest_sem_post.c30 * threads that are waiting on a single semaphore, and not all of
35 #include <semaphore.h>
41 static sem_t semaphore; variable
43 /* Thread function, just wait for the semaphore */
63 * this is used to exercize more of the semaphore code path */
64 if ( sem_init( &semaphore, 0, 1 ) < 0 ) {
65 printf( "Could not initialize semaphore: %s\n", strerror(errno) );
70 if ( pthread_create( &t[nn], NULL, thread_func, &semaphore ) < 0 ) {
78 sem_post(&semaphore);
89 if (sem_getvalue(&semaphore,
[all...]
H A Dbench_pthread.c43 #include <semaphore.h>
196 sem_t semaphore; local
198 sem_init(&semaphore, 1, 1);
199 BENCH(sem_getvalue(&semaphore,&dummy));
200 BENCH(sem_wait(&semaphore); sem_post(&semaphore));
/system/extras/tests/bionic/libc/bionic/
H A Dtest_cond.c29 #include <semaphore.h>
/system/core/libsuspend/
H A Dautosuspend_wakeup_count.c20 #include <semaphore.h>
68 ALOGE("Error waiting on semaphore: %s\n", buf);
90 ALOGE("Error releasing semaphore: %s\n", buf);
107 ALOGE("Error changing semaphore: %s\n", buf);
126 ALOGE("Error changing semaphore: %s\n", buf);
161 ALOGE("Error creating semaphore: %s\n", buf);

Completed in 4 milliseconds