/bionic/benchmarks/ |
semaphore_benchmark.cpp | 19 #include <semaphore.h> 23 sem_t semaphore; local 24 sem_init(&semaphore, 1, 1); 29 sem_getvalue(&semaphore, &dummy); 38 sem_t semaphore; local 39 sem_init(&semaphore, 1, 1); 43 sem_wait(&semaphore); 44 sem_post(&semaphore);
|
/external/bluetooth/bluedroid/test/suite/support/ |
callbacks.h | 23 #include <semaphore.h> 27 sem_t *semaphore = callbacks_get_semaphore(#callback); \ 28 sem_wait(semaphore); \ 33 sem_t *semaphore = callbacks_get_semaphore(#callback); \ 34 while (!sem_trywait(semaphore)); \ 36 sem_wait(semaphore); \ 42 sem_t *semaphore = callbacks_get_semaphore(__func__); \ 43 sem_post(semaphore); \
|
/external/bluetooth/bluedroid/osi/include/ |
semaphore.h | 26 // Creates a new semaphore with an initial value of |value|. 31 // Frees a semaphore allocated with |semaphore_new|. |semaphore| may 33 void semaphore_free(semaphore_t *semaphore); 35 // Decrements the value of |semaphore|. If it is 0, this call blocks until 36 // it becomes non-zero. |semaphore| may not be NULL. 37 void semaphore_wait(semaphore_t *semaphore); 39 // Tries to decrement the value of |semaphore|. Returns true if the value was 40 // decremented, false if the value was 0. This function never blocks. |semaphore| 42 bool semaphore_try_wait(semaphore_t *semaphore); [all...] |
/external/bluetooth/bluedroid/osi/src/ |
semaphore.c | 28 #include "semaphore.h" 43 ALOGE("%s unable to allocate semaphore: %s", __func__, strerror(errno)); 51 void semaphore_free(semaphore_t *semaphore) { 52 if (semaphore->fd != -1) 53 close(semaphore->fd); 54 free(semaphore); 57 void semaphore_wait(semaphore_t *semaphore) { 58 assert(semaphore != NULL); 59 assert(semaphore->fd != -1); 62 if (eventfd_read(semaphore->fd, &value) == -1 [all...] |
/external/deqp/framework/delibs/dethread/ |
deSemaphore.h | 23 * \brief Semaphore class. 30 /* Semaphore type. */ 34 * \brief Semaphore attributes. 42 void deSemaphore_destroy (deSemaphore semaphore); 44 void deSemaphore_increment (deSemaphore semaphore); 45 void deSemaphore_decrement (deSemaphore semaphore); 47 deBool deSemaphore_tryDecrement (deSemaphore semaphore);
|
/external/valgrind/main/drd/ |
drd_semaphore.h | 25 // Semaphore state information: owner thread and recursion count. 40 struct semaphore_info* DRD_(semaphore_init)(const Addr semaphore, 43 void DRD_(semaphore_destroy)(const Addr semaphore); 44 struct semaphore_info* DRD_(semaphore_open)(const Addr semaphore, 47 void DRD_(semaphore_close)(const Addr semaphore); 48 void DRD_(semaphore_pre_wait)(const Addr semaphore); 49 void DRD_(semaphore_post_wait)(const DrdThreadId tid, const Addr semaphore, 51 void DRD_(semaphore_pre_post)(const DrdThreadId tid, const Addr semaphore); 52 void DRD_(semaphore_post_post)(const DrdThreadId tid, const Addr semaphore,
|
drd_semaphore.c | 85 /** Enable or disable tracing of semaphore actions. */ 93 * client semaphore at client addres 'semaphore'. 97 const Addr semaphore) 99 tl_assert(semaphore != 0); 100 tl_assert(p->a1 == semaphore); 127 "Destruction of semaphore that is being waited" 138 * client semaphore. Allocate a new structure if such a structure did not 143 drd_semaphore_get_or_allocate(const Addr semaphore) 147 tl_assert(offsetof(DrdClientobj, semaphore) == 0) [all...] |
/external/deqp/framework/delibs/dethread/unix/ |
deNamedSemaphoreUnix.c | 21 * \brief Unix implementation of semaphore using named semaphores. 31 #include <semaphore.h> 36 sem_t* semaphore; member in struct:NamedSemaphore_s 59 sem->semaphore = sem_open(name, O_CREAT|O_EXCL, mode, initialValue); 61 if (sem->semaphore == SEM_FAILED) 70 void deSemaphore_destroy (deSemaphore semaphore) 72 NamedSemaphore* sem = (NamedSemaphore*)semaphore; 78 res = sem_close(sem->semaphore); 86 void deSemaphore_increment (deSemaphore semaphore) 88 sem_t* sem = ((NamedSemaphore*)semaphore)->semaphore [all...] |
deSemaphoreUnix.c | 21 * \brief Unix implementation of semaphore. 30 #include <semaphore.h> 52 void deSemaphore_destroy (deSemaphore semaphore) 54 sem_t* sem = (sem_t*)semaphore; 60 void deSemaphore_increment (deSemaphore semaphore) 62 sem_t* sem = (sem_t*)semaphore; 68 void deSemaphore_decrement (deSemaphore semaphore) 70 sem_t* sem = (sem_t*)semaphore; 76 deBool deSemaphore_tryDecrement (deSemaphore semaphore) 78 sem_t* sem = (sem_t*)semaphore; [all...] |
/external/chromium_org/v8/test/cctest/ |
test-semaphore.cc | 41 explicit WaitAndSignalThread(Semaphore* semaphore) 42 : Thread("WaitAndSignalThread"), semaphore_(semaphore) {} 56 Semaphore* semaphore_; 61 Semaphore semaphore(0); 62 WaitAndSignalThread t1(&semaphore); 63 WaitAndSignalThread t2(&semaphore); 69 semaphore.Signal(); 74 semaphore.Wait() [all...] |
/external/deqp/framework/delibs/dethread/win32/ |
deSemaphoreWin32.c | 21 * \brief Win32 implementation of semaphore. 51 void deSemaphore_destroy (deSemaphore semaphore) 53 HANDLE handle = (HANDLE)semaphore; 57 void deSemaphore_increment (deSemaphore semaphore) 59 HANDLE handle = (HANDLE)semaphore; 64 void deSemaphore_decrement (deSemaphore semaphore) 66 HANDLE handle = (HANDLE)semaphore; 71 deBool deSemaphore_tryDecrement (deSemaphore semaphore) 73 HANDLE handle = (HANDLE)semaphore;
|
/system/extras/tests/bionic/libc/common/ |
test_semaphore.c | 29 #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 ) < 0 ) [all...] |
test_sem_post.c | 30 * 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, &value) < 0) [all...] |
/cts/suite/audio_quality/lib/include/ |
Semaphore.h | 21 #include <semaphore.h> 26 * Simple semaphore interface for synchronization between client and server 28 class Semaphore { 30 Semaphore(int count = 0); 32 ~Semaphore(); 34 /// down semaphore if it is already positive.
|
/external/valgrind/main/none/tests/ |
semlimit.c | 1 #include <semaphore.h>
|
/external/valgrind/main/drd/tests/ |
tc18_semabuse.stderr.exp | 2 Semaphore reinitialization: semaphore 0x........ 5 semaphore 0x........ was first observed at: 9 Invalid semaphore: semaphore 0x........ 12 semaphore 0x........ was first observed at:
|
/development/ndk/platforms/android-3/arch-arm/include/asm/ |
semaphore.h | 23 struct semaphore { struct 31 #define __DECLARE_SEMAPHORE_GENERIC(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
|
/prebuilts/ndk/4/platforms/android-3/arch-arm/usr/include/asm/ |
semaphore.h | 23 struct semaphore { struct 31 #define __DECLARE_SEMAPHORE_GENERIC(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
|
/prebuilts/ndk/4/platforms/android-4/arch-arm/usr/include/asm/ |
semaphore.h | 23 struct semaphore { struct 31 #define __DECLARE_SEMAPHORE_GENERIC(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
|
/prebuilts/ndk/4/platforms/android-5/arch-arm/usr/include/asm/ |
semaphore.h | 23 struct semaphore { struct 31 #define __DECLARE_SEMAPHORE_GENERIC(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
|
/prebuilts/ndk/4/platforms/android-8/arch-arm/usr/include/asm/ |
semaphore.h | 23 struct semaphore { struct 31 #define __DECLARE_SEMAPHORE_GENERIC(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
|
/prebuilts/ndk/5/platforms/android-3/arch-arm/usr/include/asm/ |
semaphore.h | 23 struct semaphore { struct 31 #define __DECLARE_SEMAPHORE_GENERIC(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
|
/prebuilts/ndk/6/platforms/android-3/arch-arm/usr/include/asm/ |
semaphore.h | 23 struct semaphore { struct 31 #define __DECLARE_SEMAPHORE_GENERIC(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
|
/prebuilts/ndk/7/platforms/android-14/arch-arm/usr/include/asm/ |
semaphore.h | 23 struct semaphore { struct 31 #define __DECLARE_SEMAPHORE_GENERIC(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
|
/prebuilts/ndk/7/platforms/android-3/arch-arm/usr/include/asm/ |
semaphore.h | 23 struct semaphore { struct 31 #define __DECLARE_SEMAPHORE_GENERIC(name,count) struct semaphore name = __SEMAPHORE_INIT(name,count)
|