MAGMA  magma-1.4.0
Matrix Algebra on GPU and Multicore Architectures
 All Data Structures 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
HANDLE hThread
struct pthread_cond_s pthread_cond_t
MAGMA_DLLPORT int MAGMA_CDECL pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start)(void *), void *arg)
MAGMA_DLLPORT int MAGMA_CDECL pthread_cond_broadcast(pthread_cond_t *cond)
MAGMA_DLLPORT int MAGMA_CDECL pthread_mutex_unlock(pthread_mutex_t *mutex)
MAGMA_DLLPORT int MAGMA_CDECL pthread_join(pthread_t thread, void **value_ptr)
MAGMA_DLLPORT int MAGMA_CDECL pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
CRITICAL_SECTION cs
MAGMA_DLLPORT int MAGMA_CDECL pthread_attr_setscope(pthread_attr_t *attr, int scope)
unsigned int uThId
struct pthread_s pthread_t
MAGMA_DLLPORT unsigned int MAGMA_CDECL pthread_self_id(void)
MAGMA_DLLPORT int MAGMA_CDECL pthread_attr_destroy(pthread_attr_t *attr)
MAGMA_DLLPORT int MAGMA_CDECL pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
MAGMA_DLLPORT int MAGMA_CDECL pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
HANDLE pthread_mutex_t
MAGMA_DLLPORT int MAGMA_CDECL pthread_mutex_trylock(pthread_mutex_t *mutex)
MAGMA_DLLPORT pthread_t MAGMA_CDECL pthread_self(void)
MAGMA_DLLPORT int MAGMA_CDECL pthread_equal(pthread_t thread1, pthread_t thread2)
int pthread_mutexattr_t
MAGMA_DLLPORT int MAGMA_CDECL pthread_mutex_destroy(pthread_mutex_t *mutex)
MAGMA_DLLPORT int MAGMA_CDECL pthread_setconcurrency(int level)
#define MAGMA_CDECL
MAGMA_DLLPORT int MAGMA_CDECL pthread_mutex_lock(pthread_mutex_t *mutex)
MAGMA_DLLPORT int MAGMA_CDECL pthread_cond_destroy(pthread_cond_t *cond)
int pthread_condattr_t
#define MAGMA_DLLPORT
MAGMA_DLLPORT int MAGMA_CDECL pthread_attr_init(pthread_attr_t *attr)
int pthread_attr_t