26 #if defined(__MINGW64_VERSION_MAJOR)
37 HANDLE existing_event, created_event;
39 created_event = CreateEvent(
NULL, 1, 0,
NULL);
40 if (created_event == 0) {
45 existing_event = InterlockedCompareExchangePointer(&guard->event,
49 if (existing_event ==
NULL) {
53 result = SetEvent(created_event);
60 CloseHandle(created_event);
61 result = WaitForSingleObject(existing_event, INFINITE);
62 assert(result == WAIT_OBJECT_0);
134 if (stack_size != 0) {
138 stack_size = (stack_size + pagesize - 1) &~ (pagesize - 1);
140 if ((
unsigned)stack_size != stack_size)
154 (
unsigned)stack_size,
159 if (thread ==
NULL) {
166 ResumeThread(thread);
191 if (WaitForSingleObject(*tid, INFINITE))
208 InitializeCriticalSection(
mutex);
219 DeleteCriticalSection(
mutex);
224 EnterCriticalSection(
mutex);
229 if (TryEnterCriticalSection(
mutex))
237 LeaveCriticalSection(
mutex);
273 if (
r != WAIT_OBJECT_0)
295 if (
r == WAIT_OBJECT_0)
297 else if (
r == WAIT_TIMEOUT)
299 else if (
r == WAIT_FAILED)
328 if (
r != WAIT_OBJECT_0)
335 if (
r == WAIT_OBJECT_0)
337 else if (
r == WAIT_TIMEOUT)
360 if (!CloseHandle(*sem))
366 if (!ReleaseSemaphore(*sem, 1,
NULL))
372 if (WaitForSingleObject(*sem, INFINITE) != WAIT_OBJECT_0)
378 DWORD r = WaitForSingleObject(*sem, 0);
380 if (
r == WAIT_OBJECT_0)
383 if (
r == WAIT_TIMEOUT)
392 InitializeConditionVariable(&
cond->cond_var);
404 WakeConditionVariable(&
cond->cond_var);
409 WakeAllConditionVariable(&
cond->cond_var);
414 if (!SleepConditionVariableCS(&
cond->cond_var,
mutex, INFINITE))
421 if (GetLastError() != ERROR_TIMEOUT)
467 if (++barrier->
count == barrier->
n) {
477 serial_thread = (--barrier->
count == 0);
486 return serial_thread;
491 key->tls_index = TlsAlloc();
492 if (
key->tls_index == TLS_OUT_OF_INDEXES)
499 if (TlsFree(
key->tls_index) ==
FALSE)
501 key->tls_index = TLS_OUT_OF_INDEXES;
508 value = TlsGetValue(
key->tls_index);
510 if (GetLastError() != ERROR_SUCCESS)
static const char * arg(RzAnalysis *a, csh *handle, cs_insn *insn, char *buf, int n)
static mcore_handle handle
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
void uv_fatal_error(const int errorno, const char *syscall)
static const char struct stat static buf struct stat static buf static vhangup int struct rusage static rusage sysinfo
assert(limit<=UINT32_MAX/2)
#define cond(bop, top, mask, flags)
int uv_barrier_wait(uv_barrier_t *barrier)
int uv_rwlock_trywrlock(uv_rwlock_t *rwlock)
int uv_thread_create_ex(uv_thread_t *tid, const uv_thread_options_t *params, void(*entry)(void *arg), void *arg)
int uv_cond_init(uv_cond_t *cond)
void uv_key_set(uv_key_t *key, void *value)
void uv_cond_signal(uv_cond_t *cond)
int uv_rwlock_init(uv_rwlock_t *rwlock)
void uv_sem_wait(uv_sem_t *sem)
void uv_rwlock_rdlock(uv_rwlock_t *rwlock)
int uv_mutex_trylock(uv_mutex_t *mutex)
void uv_mutex_unlock(uv_mutex_t *mutex)
void uv_rwlock_wrlock(uv_rwlock_t *rwlock)
void * uv_key_get(uv_key_t *key)
int uv_sem_trywait(uv_sem_t *sem)
int uv_mutex_init_recursive(uv_mutex_t *mutex)
int uv_thread_join(uv_thread_t *tid)
int uv_thread_create(uv_thread_t *tid, void(*entry)(void *arg), void *arg)
void uv_sem_post(uv_sem_t *sem)
void uv_mutex_destroy(uv_mutex_t *mutex)
int uv_thread_equal(const uv_thread_t *t1, const uv_thread_t *t2)
uv_thread_t uv_thread_self(void)
void uv_once(uv_once_t *guard, void(*callback)(void))
void uv_rwlock_rdunlock(uv_rwlock_t *rwlock)
int uv_key_create(uv_key_t *key)
void uv_cond_destroy(uv_cond_t *cond)
int uv_rwlock_tryrdlock(uv_rwlock_t *rwlock)
void uv_barrier_destroy(uv_barrier_t *barrier)
int uv_cond_timedwait(uv_cond_t *cond, uv_mutex_t *mutex, uint64_t timeout)
int uv_sem_init(uv_sem_t *sem, unsigned int value)
void uv_cond_broadcast(uv_cond_t *cond)
void uv_rwlock_destroy(uv_rwlock_t *rwlock)
int uv_mutex_init(uv_mutex_t *mutex)
void uv_mutex_lock(uv_mutex_t *mutex)
void uv_cond_wait(uv_cond_t *cond, uv_mutex_t *mutex)
int uv_barrier_init(uv_barrier_t *barrier, unsigned int count)
void uv_sem_destroy(uv_sem_t *sem)
void uv_key_delete(uv_key_t *key)
void uv_rwlock_wrunlock(uv_rwlock_t *rwlock)
static UINT __stdcall uv__thread_start(void *arg)
static uv_key_t uv__current_thread_key
static uv_once_t uv__current_thread_init_guard
static void uv__init_current_thread_key(void)
STATIC_ASSERT(sizeof(uv_thread_t)<=sizeof(void *))
static void uv__once_inner(uv_once_t *guard, void(*callback)(void))
unsigned int num_readers_
CRITICAL_SECTION num_readers_lock_
struct uv_rwlock_t::@394 state_
UV_PLATFORM_SEM_T uv_sem_t
pthread_mutex_t uv_mutex_t
void error(const char *msg)
void * uv__malloc(size_t size)
@ UV_THREAD_HAS_STACK_SIZE
UV_EXTERN int uv_translate_sys_error(int sys_errno)