23 #ifndef _SWITCH_PTHREAD_WRAP_ 24 #define _SWITCH_PTHREAD_WRAP_ 33 #define THREADVARS_MAGIC 0x21545624 109 printf(
"[Threading]: Waiting for Thread Exit\n");
110 threadWaitForExit(&thread);
111 threadClose(&thread);
118 return mutexTryLock(
mutex) ? 0 : 1;
130 condvarWaitTimeout(
cond,
mutex, abstime->tv_nsec);
144 condvarWakeOne(
cond);
150 condvarWakeAll(
cond);
162 if (t1.handle == t2.handle)
static INLINE int pthread_mutex_destroy(pthread_mutex_t *mutex)
Definition: switch_pthread.h:79
#define INLINE
Definition: retro_inline.h:35
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
Definition: pte_main.c:103
Handle handle
Definition: switch_pthread.h:44
struct _reent * reent
Definition: switch_pthread.h:50
static INLINE int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
Definition: switch_pthread.h:121
static int cond(LexState *ls)
Definition: lparser.c:1177
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
static sys_sem mutex
Definition: memp.c:120
static INLINE int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
Definition: switch_pthread.h:135
static INLINE int pthread_mutex_trylock(pthread_mutex_t *mutex)
Definition: switch_pthread.h:116
INLINE int pthread_equal(pthread_t t1, pthread_t t2)
Definition: switch_pthread.h:160
static INLINE int pthread_mutex_unlock(pthread_mutex_t *mutex)
Definition: switch_pthread.h:93
Definition: implement.h:146
Definition: switch_pthread.h:38
static INLINE int pthread_cond_broadcast(pthread_cond_t *cond)
Definition: switch_pthread.h:148
Definition: psp_pthread.h:45
static INLINE int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
Definition: switch_pthread.h:72
static INLINE ThreadVars * getThreadVars(void)
Definition: switch_pthread.h:56
void * pthread_t
Definition: pthread.h:398
void pthread_exit(void *retval)
Definition: pthread.c:648
static INLINE int pthread_join(pthread_t thread, void **retval)
Definition: switch_pthread.h:107
void * tls_tp
Definition: switch_pthread.h:53
INLINE int pthread_detach(pthread_t thread)
Definition: switch_pthread.h:100
static INLINE pthread_t pthread_self(void)
Definition: switch_pthread.h:67
static INLINE int pthread_mutex_lock(pthread_mutex_t *mutex)
Definition: switch_pthread.h:87
static INLINE int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime)
Definition: switch_pthread.h:128
INLINE int pthread_cond_destroy(pthread_cond_t *cond)
Definition: switch_pthread.h:154
u32 magic
Definition: switch_pthread.h:41
Definition: implement.h:163
Definition: implement.h:116
static INLINE Thread threadGetCurrent(void)
Definition: switch_pthread.h:61
uint8_t u8
8bit unsigned integer
Definition: gctypes.h:17
Definition: implement.h:251
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
static INLINE int pthread_cond_signal(pthread_cond_t *cond)
Definition: switch_pthread.h:142
Thread * thread_ptr
Definition: switch_pthread.h:47