ObjFW  Diff

Differences From Artifact [ea45b83ab4]:

To Artifact [907c5a1a16]:


92
93
94
95
96
97
98
99

100



101
102
103















104
105

106
107
108
109
110
111
112
92
93
94
95
96
97
98

99
100
101
102
103
104


105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

121
122
123
124
125
126
127
128







-
+

+
+
+

-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

-
+







}

+ (OFThread*)currentThread
{
	return of_tlskey_get(thread_self);
}

+ (void)sleepForNMilliseconds: (unsigned int)msecs;
+ (void)sleepForTimeInterval: (int64_t)sec
{
	if (sec < 0)
		@throw [OFOutOfRangeException newWithClass: self];

#ifndef _WIN32
	sleep(msecs / 1000);
	usleep((msecs % 1000) * 1000);
	sleep(sec);
#else
	Sleep(sec * 1000);
#endif
}

+ (void)sleepForTimeInterval: (int64_t)sec
		microseconds: (uint32_t)usec
{
	if (sec < 0)
		@throw [OFOutOfRangeException newWithClass: self];

#ifndef _WIN32
	sleep(sec);
	usleep(usec);
#else
	Sleep(msecs);
	Sleep(sec * 1000 + usec / 1000);
#endif
}

+ (void)sleepUntilDate: (OFDate*)date
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	OFDate *now = [OFDate date];