change windows compatibility stubs for pthread_t to be more like other OSes
This commit is contained in:
parent
ff7a18318c
commit
387d2ae261
@ -38,23 +38,18 @@ pthread_once(pthread_once_t *once, void (*cb) (void))
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct pthread {
|
typedef DWORD pthread_t;
|
||||||
HANDLE handle;
|
|
||||||
};
|
|
||||||
typedef struct pthread pthread_t;
|
|
||||||
|
|
||||||
static inline pthread_t
|
static inline pthread_t
|
||||||
pthread_self(void)
|
pthread_self(void)
|
||||||
{
|
{
|
||||||
pthread_t self;
|
return GetCurrentThreadId();
|
||||||
self.handle = GetCurrentThread();
|
|
||||||
return self;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
pthread_equal(pthread_t t1, pthread_t t2)
|
pthread_equal(pthread_t t1, pthread_t t2)
|
||||||
{
|
{
|
||||||
return t1.handle == t2.handle;
|
return t1 == t2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user