Differences From Artifact [9adc83c2c8]:
- File
src/OFThread.m
— part of check-in
[5831626f68]
at
2018-05-13 19:24:28
on branch trunk
— platform.h: Rename OF_AMIGAOS3 to OF_AMIGAOS_M68K
The reason for this is that, in theory, this also supports versions
older than 3. (user: js, size: 9283) [annotate] [blame] [check-ins using]
To Artifact [a7a9564a2b]:
- File
src/OFThread.m
— part of check-in
[3c20dd5f95]
at
2018-05-26 14:46:35
on branch trunk
— Use trunc() instead of floor() in several places
floor() does not have the desired effect here when the number is
negative. (user: js, size: 9283) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
200 201 202 203 204 205 206 | Sleep((unsigned int)(timeInterval * 1000)); #elif defined(HAVE_NANOSLEEP) struct timespec rqtp; rqtp.tv_sec = (time_t)timeInterval; rqtp.tv_nsec = lrint((timeInterval - rqtp.tv_sec) * 1000000000); | | | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | Sleep((unsigned int)(timeInterval * 1000)); #elif defined(HAVE_NANOSLEEP) struct timespec rqtp; rqtp.tv_sec = (time_t)timeInterval; rqtp.tv_nsec = lrint((timeInterval - rqtp.tv_sec) * 1000000000); if (rqtp.tv_sec != trunc(timeInterval)) @throw [OFOutOfRangeException exception]; nanosleep(&rqtp, NULL); #elif defined(OF_AMIGAOS) if (timeInterval * 50 > ULONG_MAX) @throw [OFOutOfRangeException exception]; |
︙ | ︙ | |||
229 230 231 232 233 234 235 | svcSleepThread((int64_t)(timeInterval * 1000000000)); #else if (timeInterval > UINT_MAX) @throw [OFOutOfRangeException exception]; sleep((unsigned int)timeInterval); usleep((unsigned int)lrint( | | | 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | svcSleepThread((int64_t)(timeInterval * 1000000000)); #else if (timeInterval > UINT_MAX) @throw [OFOutOfRangeException exception]; sleep((unsigned int)timeInterval); usleep((unsigned int)lrint( (timeInterval - trunc(timeInterval)) * 1000000)); #endif } + (void)sleepUntilDate: (OFDate *)date { [self sleepForTimeInterval: [date timeIntervalSinceNow]]; } |
︙ | ︙ |