You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//alternative is QueryPerformanceCounter; it probably uses rdtsc, which is stable on recent processors, but it gives inconsistent results when the processor goes to sleep
//is there EINTR on windows? Does it manifest as a spurious wake with no error?
113
-
REVFACE;}
104
+
// defined in cd.c to avoid name collisions between j.h and windows.h
114
105
#endif
115
106
116
-
#if defined(__APPLE__) || defined(__linux__)
117
107
enum{FREE=0,LOCK=1,WAIT=2};//values for mutex->v
118
108
//todo consider storing owner in the high bits of v. apple pthreads does this. But it means we can't use xadd to unlock. On the other hand, apple is mostly arm now, which doesn't have xadd anyway.
119
109
//Also, I just realised you _can_ use xadd to unlock--subtract the top bits at the same time as the bottom one--it just adds a weird state where the low bit is 1, but the high bits don't denote any task--but that's ok
@@ -168,4 +158,3 @@ C jtpthread_mutex_unlock(jtpthread_mutex_t *m,I self){
0 commit comments