Skip to content

Commit 9fe1064

Browse files
committed
Merge branch 'master' of jsoftware.com:jsource
2 parents b44200d + 959eade commit 9fe1064

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

jsrc/mt.h

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@
44
#if PYXES
55
#ifndef __APPLE__
66
#include <pthread.h>
7-
#if SY_WIN32
8-
struct timezone {
9-
int tz_minuteswest;
10-
int tz_dsttime;
11-
};
12-
13-
// Tip o'hat to Michaelangel007 on StackOverflow
14-
// MSVC defines this in winsock2.h!?
15-
typedef struct timeval {
16-
long tv_sec;
17-
long tv_usec;
18-
} timeval;
19-
extern int gettimeofday(struct timeval * tp, struct timezone * tzp);
20-
#endif
217
typedef pthread_mutex_t jtpthread_mutex_t;
228
static inline void jtpthread_mutex_init(jtpthread_mutex_t *m,B recursive){
239
if(likely(!recursive)){pthread_mutex_init(m,0);}
@@ -32,7 +18,11 @@ static inline C jtpthread_mutex_lock(J jt,jtpthread_mutex_t *m,I self){
3218
if(r==EDEADLK)R EVCONCURRENCY;
3319
R EVFACE;}
3420
static inline I jtpthread_mutex_timedlock(J jt,jtpthread_mutex_t *m,UI ns,I self){
35-
#if _WIN32
21+
#if SY_WIN32
22+
// Tip o'hat to Michaelangel007 on StackOverflow
23+
// MSVC defines this in winsock2.h!?
24+
struct timeval { long tv_sec; long tv_usec; }; struct timezone;
25+
extern int gettimeofday(struct timeval * tp, struct timezone * tzp);
3626
struct timeval now;gettimeofday(&now,0);
3727
struct timespec t;
3828
t.tv_sec=now.tv_sec+ns/1000000000;t.tv_nsec=1000*now.tv_usec+ns%1000000000;if(t.tv_nsec>=1000000000){t.tv_sec++;t.tv_nsec-=1000000000;}

0 commit comments

Comments
 (0)