aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2018-11-11 11:00:00 -0600
committerBrent Cook <busterb@gmail.com>2018-11-11 11:00:00 -0600
commit387d2ae261c64396036a1c53e303364b03444257 (patch)
tree496c0cca183a064ffd005c81d96e55b927845eae
parentff7a18318c3e6686df1d31c390ecc7fe5bc9f23e (diff)
downloadportable-387d2ae261c64396036a1c53e303364b03444257.tar.gz
portable-387d2ae261c64396036a1c53e303364b03444257.tar.bz2
portable-387d2ae261c64396036a1c53e303364b03444257.zip
change windows compatibility stubs for pthread_t to be more like other OSes
Diffstat (limited to '')
-rw-r--r--include/compat/pthread.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/include/compat/pthread.h b/include/compat/pthread.h
index b2db760..861c8e1 100644
--- a/include/compat/pthread.h
+++ b/include/compat/pthread.h
@@ -38,23 +38,18 @@ pthread_once(pthread_once_t *once, void (*cb) (void))
38 return 0; 38 return 0;
39} 39}
40 40
41struct pthread { 41typedef DWORD pthread_t;
42 HANDLE handle;
43};
44typedef struct pthread pthread_t;
45 42
46static inline pthread_t 43static inline pthread_t
47pthread_self(void) 44pthread_self(void)
48{ 45{
49 pthread_t self; 46 return GetCurrentThreadId();
50 self.handle = GetCurrentThread();
51 return self;
52} 47}
53 48
54static inline int 49static inline int
55pthread_equal(pthread_t t1, pthread_t t2) 50pthread_equal(pthread_t t1, pthread_t t2)
56{ 51{
57 return t1.handle == t2.handle; 52 return t1 == t2;
58} 53}
59 54
60#else 55#else