C11
[ps4-sdk.git] / source / pthread.c
blobc525dcff2d068957a1d0993c08b89b54e3629e6e
1 #include "kernel.h"
2 #include "module.h"
4 #include "pthread.h"
6 int (*scePthreadCreate)(ScePthread *thread, const ScePthreadAttr *attr, void *(*entry) (void *), void *arg, const char *name);
7 void (*scePthreadExit)(void *value);
8 int (*scePthreadDetach)(ScePthread thread);
9 int (*scePthreadJoin)(ScePthread thread, void **value_ptr);
10 void (*scePthreadYield)(void);
11 ScePthread (*scePthreadSelf)(void);
12 int (*scePthreadCancel)(ScePthread thread);
14 int (*scePthreadMutexInit)(ScePthreadMutex *mutex, const ScePthreadMutexattr *attr, const char *name);
15 int (*scePthreadMutexDestroy)(ScePthreadMutex *mutex);
16 int (*scePthreadMutexLock)(ScePthreadMutex *mutex);
17 int (*scePthreadMutexTrylock)(ScePthreadMutex *mutex);
18 int (*scePthreadMutexTimedlock)(ScePthreadMutex *mutex, SceKernelUseconds usec);
19 int (*scePthreadMutexUnlock)(ScePthreadMutex *mutex);
21 void initPthread(void) {
22 int libkernel;
23 loadModule("libkernel.sprx", &libkernel);
25 RESOLVE(libkernel, scePthreadCreate);
26 RESOLVE(libkernel, scePthreadExit);
27 RESOLVE(libkernel, scePthreadDetach);
28 RESOLVE(libkernel, scePthreadJoin);
29 RESOLVE(libkernel, scePthreadYield);
30 RESOLVE(libkernel, scePthreadSelf);
31 RESOLVE(libkernel, scePthreadCancel);
33 RESOLVE(libkernel, scePthreadMutexInit);
34 RESOLVE(libkernel, scePthreadMutexDestroy);
35 RESOLVE(libkernel, scePthreadMutexLock);
36 RESOLVE(libkernel, scePthreadMutexTrylock);
37 RESOLVE(libkernel, scePthreadMutexTimedlock);
38 RESOLVE(libkernel, scePthreadMutexUnlock);