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

123456

/external/bluetooth/bluedroid/test/suite/support/
H A Dcallbacks.h23 #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); \
H A Dcallbacks.c44 sem_t semaphore; member in struct:__anon1730
90 sem_init(&callback_data[i].semaphore, 0, 0);
96 sem_destroy(&callback_data[i].semaphore);
111 return &callback_data[i].semaphore;
/external/bluetooth/bluedroid/osi/include/
H A Dsemaphore.h26 // 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/
H A Dsemaphore.c28 #include "semaphore.h"
43 ALOGE("%s unable to allocate semaphore: %s", __func__, strerror(errno));
51 void semaphore_free(semaphore_t *semaphore) { argument
52 if (semaphore->fd != -1)
53 close(semaphore->fd);
54 free(semaphore);
57 void semaphore_wait(semaphore_t *semaphore) { argument
58 assert(semaphore != NULL);
59 assert(semaphore->fd != -1);
62 if (eventfd_read(semaphore
66 semaphore_try_wait(semaphore_t *semaphore) argument
89 semaphore_post(semaphore_t *semaphore) argument
97 semaphore_get_fd(const semaphore_t *semaphore) argument
[all...]
/external/deqp/framework/delibs/dethread/
H A DdeSemaphore.h42 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/
H A Ddrd_semaphore.h40 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,
H A Ddrd_semaphore.c85 /** 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) argument
147 tl_assert(offsetof(DrdClientobj, semaphore)
96 drd_semaphore_initialize(struct semaphore_info* const p, const Addr semaphore) argument
162 semaphore_get(const Addr semaphore) argument
169 semaphore_init(const Addr semaphore, const Word pshared, const UInt value) argument
218 semaphore_destroy(const Addr semaphore) argument
247 semaphore_open(const Addr semaphore, const HChar* name, const Word oflag, const Word mode, const UInt value) argument
291 semaphore_close(const Addr semaphore) argument
320 semaphore_pre_wait(const Addr semaphore) argument
344 semaphore_post_wait(const DrdThreadId tid, const Addr semaphore, const Bool waited) argument
403 semaphore_pre_post(const DrdThreadId tid, const Addr semaphore) argument
426 semaphore_post_post(const DrdThreadId tid, const Addr semaphore, const Bool succeeded) argument
[all...]
/external/deqp/framework/delibs/dethread/unix/
H A DdeNamedSemaphoreUnix.c21 * \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) argument
72 NamedSemaphore* sem = (NamedSemaphore*)semaphore;
78 res = sem_close(sem->semaphore);
86 void deSemaphore_increment (deSemaphore semaphore) argument
88 sem_t* sem = ((NamedSemaphore*)semaphore)
94 deSemaphore_decrement(deSemaphore semaphore) argument
102 deSemaphore_tryDecrement(deSemaphore semaphore) argument
[all...]
H A DdeSemaphoreUnix.c21 * \brief Unix implementation of semaphore.
30 #include <semaphore.h>
52 void deSemaphore_destroy (deSemaphore semaphore) argument
54 sem_t* sem = (sem_t*)semaphore;
60 void deSemaphore_increment (deSemaphore semaphore) argument
62 sem_t* sem = (sem_t*)semaphore;
68 void deSemaphore_decrement (deSemaphore semaphore) argument
70 sem_t* sem = (sem_t*)semaphore;
76 deBool deSemaphore_tryDecrement (deSemaphore semaphore) argument
78 sem_t* sem = (sem_t*)semaphore;
[all...]
/external/chromium_org/v8/src/base/platform/
H A Dsemaphore-unittest.cc8 #include "src/base/platform/semaphore.h"
74 explicit WaitAndSignalThread(Semaphore* semaphore) argument
75 : Thread(Options("WaitAndSignalThread")), semaphore_(semaphore) {}
108 Semaphore semaphore(0);
109 WaitAndSignalThread t1(&semaphore);
110 WaitAndSignalThread t2(&semaphore);
116 semaphore.Signal();
121 semaphore.Wait();
123 EXPECT_FALSE(semaphore.WaitFor(TimeDelta::FromMicroseconds(1)));
128 Semaphore semaphore(
[all...]
H A Dsemaphore.h14 #include <mach/semaphore.h> // NOLINT
16 #include <semaphore.h> // NOLINT
28 // A semaphore object is a synchronization object that maintains a count. The
29 // count is decremented each time a thread completes a wait for the semaphore
30 // object and incremented each time a thread signals the semaphore. When the
31 // count reaches zero, threads waiting for the semaphore blocks until the
39 // Increments the semaphore counter.
42 // Suspends the calling thread until the semaphore counter is non zero
43 // and then decrements the semaphore counter.
48 // counter is unchanged. Otherwise the semaphore counte
[all...]
/external/deqp/framework/delibs/dethread/win32/
H A DdeSemaphoreWin32.c21 * \brief Win32 implementation of semaphore.
51 void deSemaphore_destroy (deSemaphore semaphore) argument
53 HANDLE handle = (HANDLE)semaphore;
57 void deSemaphore_increment (deSemaphore semaphore) argument
59 HANDLE handle = (HANDLE)semaphore;
64 void deSemaphore_decrement (deSemaphore semaphore) argument
66 HANDLE handle = (HANDLE)semaphore;
71 deBool deSemaphore_tryDecrement (deSemaphore semaphore) argument
73 HANDLE handle = (HANDLE)semaphore;
/external/valgrind/main/none/tests/
H A Dsemlimit.c1 #include <semaphore.h>
/external/valgrind/main/drd/tests/
H A Dtc18_semabuse.stderr.exp2 Semaphore reinitialization: semaphore 0x........
5 semaphore 0x........ was first observed at:
9 Invalid semaphore: semaphore 0x........
12 semaphore 0x........ was first observed at:
H A Dlinuxthreads_det.c7 #include <semaphore.h>
/external/qemu/include/qemu/
H A Dthread-posix.h4 #include <semaphore.h>
/external/chromium_org/chrome/android/java/src/org/chromium/chrome/browser/sync/
H A DChromiumSyncAdapter.java64 Semaphore semaphore = new Semaphore(0);
68 getStartupCallback(mApplication, account, extras, syncResult, semaphore);
69 startBrowserProcess(callback, syncResult, semaphore);
73 semaphore.acquire();
83 final SyncResult syncResult, Semaphore semaphore) {
107 semaphore.release();
129 final SyncResult syncResult, final Semaphore semaphore) {
154 semaphore.release();
163 semaphore.release();
81 startBrowserProcess( final BrowserStartupController.StartupCallback callback, final SyncResult syncResult, Semaphore semaphore) argument
127 getStartupCallback( final Context context, final Account acct, Bundle extras, final SyncResult syncResult, final Semaphore semaphore) argument
/external/chromium_org/third_party/angle/src/common/
H A Dtls.h19 # include <semaphore.h>
/external/deqp/framework/platform/android/
H A DtcuAndroidRenderActivity.hpp64 de::Semaphore* semaphore; member in union:tcu::Android::Message::__anon19769
99 Message (MessageType type_, de::Semaphore* semaphore) argument
103 DE_ASSERT(semaphore);
104 payload.semaphore = semaphore;
/external/srec/portable/include/
H A Dptrd.h301 * Creates a thread semaphore.
303 * @param semaphore Handle to the created semaphore.
304 * @param initValue Initial semaphore value
305 * @param maxValue Maximum semaphore value
312 PtrdSemaphore **semaphore);
315 * Destroy a semaphore
317 * @param semaphore Handle to the semaphore to destroy
322 PORTABLE_API ESR_ReturnCode PtrdSemaphoreDestroy(PtrdSemaphore *semaphore);
[all...]
/external/bluetooth/bluedroid/osi/test/
H A Dalarm_test.cpp8 #include "semaphore.h"
13 static semaphore_t *semaphore; variable
37 semaphore = semaphore_new(0);
54 semaphore_post(semaphore);
138 semaphore_wait(semaphore);
153 semaphore_wait(semaphore);
173 semaphore_wait(semaphore);
178 semaphore_wait(semaphore);
199 semaphore_wait(semaphore);
204 semaphore_wait(semaphore);
[all...]
/external/jmdns/src/javax/jmdns/impl/
H A DDNSStatefulObject.java25 * This class define a semaphore. On this multiple threads can wait the arrival of one event. Thread wait for a maximum defined by the timeout.
57 Semaphore semaphore = _semaphores.get(thread);
58 if (semaphore == null) {
59 semaphore = new Semaphore(1, true);
60 semaphore.drainPermits();
61 _semaphores.putIfAbsent(thread, semaphore);
63 semaphore = _semaphores.get(thread);
65 semaphore.tryAcquire(timeout, TimeUnit.MILLISECONDS);
72 * Signals the semaphore when the event arrives.
76 for (Semaphore semaphore
[all...]
/external/chromium_org/v8/test/cctest/
H A Dtest-threads.cc129 v8::base::Semaphore* semaphore)
134 semaphore_(semaphore) {}
161 v8::base::Semaphore semaphore(0);
165 new ThreadIdValidationThread(prev, &refs, i, &semaphore);
172 semaphore.Wait();
127 ThreadIdValidationThread(v8::base::Thread* thread_to_start, i::List<i::ThreadId>* refs, unsigned int thread_no, v8::base::Semaphore* semaphore) argument
H A Dtest-circular-queue.cc144 v8::base::Semaphore semaphore(0);
146 ProducerThread producer1(&scq, kRecordsPerChunk, 1, &semaphore);
147 ProducerThread producer2(&scq, kRecordsPerChunk, 10, &semaphore);
148 ProducerThread producer3(&scq, kRecordsPerChunk, 20, &semaphore);
152 semaphore.Wait();
164 semaphore.Wait();
176 semaphore.Wait();
/external/chromium_org/native_client_sdk/src/libraries/sdk_util/
H A Dthread_pool.h11 #include <semaphore.h>

Completed in 420 milliseconds

123456