Differences From Artifact [95ced5e160]:
- File
src/OFThread.m
— part of check-in
[c19b2b5726]
at
2011-09-17 20:17:43
on branch trunk
— Remove +[OFThread sleepForTimeInterval:microseconds:].
Also fixes the forgotten change to double in +[sleepForTimeInterval:]
and fixes two warnings due to missing casts from double to uint32_t. (user: js, size: 9659) [annotate] [blame] [check-ins using]
To Artifact [e46284151e]:
- File src/OFThread.m — part of check-in [6ec0a033bd] at 2011-09-19 11:39:15 on branch trunk — Fix calculation of microseconds. (user: js, size: 9643) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
164 165 166 167 168 169 170 | @throw [OFOutOfRangeException newWithClass: self]; #ifndef _WIN32 if (seconds > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; sleep((unsigned int)seconds); | | | | 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | @throw [OFOutOfRangeException newWithClass: self]; #ifndef _WIN32 if (seconds > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; sleep((unsigned int)seconds); usleep((useconds_t)fmod(seconds * 1000000, 1000000)); #else if (seconds * 1000 > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; Sleep((unsigned int)(seconds * 1000)); #endif } + (void)sleepUntilDate: (OFDate*)date { double seconds = [date timeIntervalSinceNow]; #ifndef _WIN32 if (seconds > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; sleep((unsigned int)seconds); usleep((useconds_t)fmod(seconds * 1000000, 1000000)); #else if (seconds * 1000 > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; Sleep((unsigned int)(seconds * 1000)); #endif } |
︙ | ︙ |