25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
+
+
-
+
-
+
-
+
|
#include <time.h>
/* Work around __block being used by glibc */
#ifdef __GLIBC__
# undef __USE_XOPEN
#endif
#include "platform.h"
#ifndef _WIN32
#ifndef OF_WINDOWS
# include <unistd.h>
#endif
#ifdef OF_HAVE_SCHED_YIELD
# include <sched.h>
#endif
#ifdef __wii__
#ifdef OF_WII
# define BOOL OGC_BOOL
# define nanosleep ogc_nanosleep
# include <ogcsys.h>
# undef BOOL
# undef nanosleep
#endif
#import "OFThread.h"
#import "OFThread+Private.h"
#import "OFRunLoop.h"
#import "OFList.h"
#import "OFDate.h"
#import "OFDictionary.h"
#import "OFAutoreleasePool.h"
#import "OFAutoreleasePool+Private.h"
#ifdef _WIN32
#ifdef OF_WINDOWS
# include <windows.h>
#endif
#ifdef OF_NINTENDO_DS
# define asm __asm__
# include <nds.h>
# undef asm
|
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
|
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
-
+
|
#endif
+ (void)sleepForTimeInterval: (of_time_interval_t)timeInterval
{
if (timeInterval < 0)
return;
#if defined(_WIN32)
#if defined(OF_WINDOWS)
if (timeInterval * 1000 > UINT_MAX)
@throw [OFOutOfRangeException exception];
Sleep((unsigned int)(timeInterval * 1000));
#elif defined(HAVE_NANOSLEEP)
struct timespec rqtp;
|