MAGMA  1.2.0
MatrixAlgebraonGPUandMulticoreArchitectures
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
magmawinthread.h
Go to the documentation of this file.
1 
18 #ifndef MAGMAWINTHREAD_H
19 #define MAGMAWINTHREAD_H
20 
21 #include <windows.h>
22 
23 /*
24 typedef struct pthread_s {
25  HANDLE Hth;
26  unsigned IDth;
27  void *(*Fth) (void *);
28 } pthread_t;
29 */
30 typedef struct pthread_s {
31  HANDLE hThread;
32  unsigned int uThId;
33 } pthread_t;
34 
35 typedef HANDLE pthread_mutex_t;
36 typedef int pthread_mutexattr_t;
37 typedef int pthread_attr_t;
38 typedef int pthread_condattr_t;
39 
40 typedef struct pthread_cond_s {
41  HANDLE hSem;
42  HANDLE hEvt;
43  CRITICAL_SECTION cs;
44  int waitCount; /* waiting thread counter */
46 
47 typedef int pthread_attr_t;
48 
49 #define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) -1)
50 
51 #define PTHREAD_SCOPE_SYSTEM 1
52 
53 #define MAGMA_DLLPORT
54 #define MAGMA_CDECL __cdecl
55 
65 MAGMA_DLLPORT int MAGMA_CDECL pthread_create(pthread_t *tid, const pthread_attr_t *attr, void *(*start) (void *), void *arg);
70 MAGMA_DLLPORT int MAGMA_CDECL pthread_join(pthread_t thread, void **value_ptr);
72 
74 
75 MAGMA_DLLPORT unsigned int MAGMA_CDECL pthread_self_id(void);
76 
77 #endif