00001
00014 #ifndef PLASMWINTHREAD_H
00015 #define PLASMWINTHREAD_H
00016
00017 #include <windows.h>
00018
00019
00020
00021
00022
00023
00024
00025
00026 typedef struct pthread_s {
00027 HANDLE hThread;
00028 unsigned int uThId;
00029 } pthread_t;
00030
00031 typedef HANDLE pthread_mutex_t;
00032 typedef int pthread_mutexattr_t;
00033 typedef int pthread_attr_t;
00034 typedef int pthread_condattr_t;
00035
00036 typedef struct pthread_cond_s {
00037 HANDLE hSem;
00038 HANDLE hEvt;
00039 CRITICAL_SECTION cs;
00040 int waitCount;
00041 } pthread_cond_t;
00042
00043 typedef int pthread_attr_t;
00044
00045 #define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) -1)
00046
00047 #define PTHREAD_SCOPE_SYSTEM 1
00048
00049 #define PLASMA_DLLPORT
00050 #define PLASMA_CDECL __cdecl
00051
00052 PLASMA_DLLPORT pthread_t PLASMA_CDECL pthread_self(void);
00053 PLASMA_DLLPORT int PLASMA_CDECL pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t * attr);
00054 PLASMA_DLLPORT int PLASMA_CDECL pthread_mutex_destroy(pthread_mutex_t *mutex);
00055 PLASMA_DLLPORT int PLASMA_CDECL pthread_mutex_lock(pthread_mutex_t *mutex);
00056 PLASMA_DLLPORT int PLASMA_CDECL pthread_mutex_trylock(pthread_mutex_t *mutex);
00057 PLASMA_DLLPORT int PLASMA_CDECL pthread_mutex_unlock(pthread_mutex_t *mutex);
00058 PLASMA_DLLPORT int PLASMA_CDECL pthread_attr_init(pthread_attr_t *attr);
00059 PLASMA_DLLPORT int PLASMA_CDECL pthread_attr_destroy(pthread_attr_t *attr);
00060 PLASMA_DLLPORT int PLASMA_CDECL pthread_attr_setscope(pthread_attr_t *attr, int scope);
00061 PLASMA_DLLPORT int PLASMA_CDECL pthread_create(pthread_t *tid, const pthread_attr_t *attr, void *(*start) (void *), void *arg);
00062 PLASMA_DLLPORT int PLASMA_CDECL pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr);
00063 PLASMA_DLLPORT int PLASMA_CDECL pthread_cond_destroy(pthread_cond_t *cond);
00064 PLASMA_DLLPORT int PLASMA_CDECL pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
00065 PLASMA_DLLPORT int PLASMA_CDECL pthread_cond_broadcast(pthread_cond_t *cond);
00066 PLASMA_DLLPORT int PLASMA_CDECL pthread_join(pthread_t thread, void **value_ptr);
00067 PLASMA_DLLPORT int PLASMA_CDECL pthread_equal(pthread_t thread1, pthread_t thread2);
00068
00069 PLASMA_DLLPORT int PLASMA_CDECL pthread_setconcurrency (int);
00070
00071 PLASMA_DLLPORT unsigned int PLASMA_CDECL pthread_self_id(void);
00072
00073 #endif