Differences From Artifact [8714631aa6]:
- File src/OFThread.m — part of check-in [4bef853a72] at 2011-09-17 15:20:48 on branch trunk — Change OFDate to use and export doubles. (user: js, size: 9982) [annotate] [blame] [check-ins using]
To 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]
︙ | ︙ | |||
154 155 156 157 158 159 160 | } + (OFThread*)currentThread { return [[of_tlskey_get(threadSelf) retain] autorelease]; } | | > | < < < < < < < < < < < < < < < < < | | | 154 155 156 157 158 159 160 161 162 163 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 197 198 199 200 201 | } + (OFThread*)currentThread { return [[of_tlskey_get(threadSelf) retain] autorelease]; } + (void)sleepForTimeInterval: (double)seconds { if (seconds < 0) @throw [OFOutOfRangeException newWithClass: self]; #ifndef _WIN32 if (seconds > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; sleep((unsigned int)seconds); usleep((uint32_t)nearbyint(remainder(seconds, 1) * 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((uint32_t)nearbyint(remainder(seconds, 1) * 1000000)); #else if (seconds * 1000 > UINT_MAX) @throw [OFOutOfRangeException newWithClass: self]; Sleep((unsigned int)(seconds * 1000)); #endif } + (void)yield { #ifdef OF_HAVE_SCHED_YIELD sched_yield(); |
︙ | ︙ |