PLASMA  2.4.6
 All Data Structures Functions Groups
plasmawinthread.h
1 
14 #ifndef PLASMWINTHREAD_H
15 #define PLASMWINTHREAD_H
16 
17 #include <windows.h>
18 
19 /*
20 typedef struct pthread_s {
21  HANDLE Hth;
22  unsigned IDth;
23  void *(*Fth) (void *);
24 } pthread_t;
25 */
26 typedef struct pthread_s {
27  HANDLE hThread;
28  unsigned int uThId;
29 } pthread_t;
30 
31 typedef HANDLE pthread_mutex_t;
32 typedef int pthread_mutexattr_t;
33 typedef int pthread_attr_t;
34 typedef int pthread_condattr_t;
35 
36 typedef struct pthread_cond_s {
37  HANDLE hSem;
38  HANDLE hEvt;
39  CRITICAL_SECTION cs;
40  int waitCount; /* waiting thread counter */
42 
43 typedef int pthread_attr_t;
44 
45 #define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) -1)
46 
47 #define PTHREAD_SCOPE_SYSTEM 1
48 
49 #define PLASMA_DLLPORT
50 #define PLASMA_CDECL __cdecl
51 
52 PLASMA_DLLPORT pthread_t PLASMA_CDECL pthread_self(void);
53 PLASMA_DLLPORT int PLASMA_CDECL pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t * attr);
54 PLASMA_DLLPORT int PLASMA_CDECL pthread_mutex_destroy(pthread_mutex_t *mutex);
55 PLASMA_DLLPORT int PLASMA_CDECL pthread_mutex_lock(pthread_mutex_t *mutex);
56 PLASMA_DLLPORT int PLASMA_CDECL pthread_mutex_trylock(pthread_mutex_t *mutex);
57 PLASMA_DLLPORT int PLASMA_CDECL pthread_mutex_unlock(pthread_mutex_t *mutex);
58 PLASMA_DLLPORT int PLASMA_CDECL pthread_attr_init(pthread_attr_t *attr);
59 PLASMA_DLLPORT int PLASMA_CDECL pthread_attr_destroy(pthread_attr_t *attr);
60 PLASMA_DLLPORT int PLASMA_CDECL pthread_attr_setscope(pthread_attr_t *attr, int scope);
61 PLASMA_DLLPORT int PLASMA_CDECL pthread_create(pthread_t *tid, const pthread_attr_t *attr, void *(*start) (void *), void *arg);
62 PLASMA_DLLPORT int PLASMA_CDECL pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr);
63 PLASMA_DLLPORT int PLASMA_CDECL pthread_cond_destroy(pthread_cond_t *cond);
64 PLASMA_DLLPORT int PLASMA_CDECL pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex);
65 PLASMA_DLLPORT int PLASMA_CDECL pthread_cond_broadcast(pthread_cond_t *cond);
66 PLASMA_DLLPORT int PLASMA_CDECL pthread_join(pthread_t thread, void **value_ptr);
67 PLASMA_DLLPORT int PLASMA_CDECL pthread_equal(pthread_t thread1, pthread_t thread2);
68 
69 PLASMA_DLLPORT int PLASMA_CDECL pthread_setconcurrency (int);
70 
71 PLASMA_DLLPORT unsigned int PLASMA_CDECL pthread_self_id(void);
72 
73 #endif