ObjFW  Diff

Differences From Artifact [666629e8be]:

To Artifact [3b9d6bd50a]:


83
84
85
86
87
88
89
90
91
92
93
94
95
96
97

#ifdef OF_HAVE_ATOMIC_OPS
# import "atomic.h"
#endif

#ifdef __DJGPP__
# define lrint(x) rint(x)
# define useconds_t unsigned int
#endif

#ifdef OF_HAVE_THREADS
# import "threading.h"

static of_tlskey_t threadSelfKey;
static OFThread *mainThread;







<







83
84
85
86
87
88
89

90
91
92
93
94
95
96

#ifdef OF_HAVE_ATOMIC_OPS
# import "atomic.h"
#endif

#ifdef __DJGPP__
# define lrint(x) rint(x)

#endif

#ifdef OF_HAVE_THREADS
# import "threading.h"

static of_tlskey_t threadSelfKey;
static OFThread *mainThread;
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227

	svcSleepThread((int64_t)(timeInterval * 1000000000));
#else
	if (timeInterval > UINT_MAX)
		@throw [OFOutOfRangeException exception];

	sleep((unsigned int)timeInterval);
	usleep((useconds_t)lrint(
	    (timeInterval - floor(timeInterval)) * 1000000));
#endif
}

+ (void)sleepUntilDate: (OFDate *)date
{
	[self sleepForTimeInterval: [date timeIntervalSinceNow]];







|







212
213
214
215
216
217
218
219
220
221
222
223
224
225
226

	svcSleepThread((int64_t)(timeInterval * 1000000000));
#else
	if (timeInterval > UINT_MAX)
		@throw [OFOutOfRangeException exception];

	sleep((unsigned int)timeInterval);
	usleep((unsigned int)lrint(
	    (timeInterval - floor(timeInterval)) * 1000000));
#endif
}

+ (void)sleepUntilDate: (OFDate *)date
{
	[self sleepForTimeInterval: [date timeIntervalSinceNow]];