Overview
Comment: | Remove +[OFThread sleepForTimeInterval:microseconds:].
Also fixes the forgotten change to double in +[sleepForTimeInterval:] |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
c19b2b5726f64b5ed668a46776e174d9 |
User & Date: | js on 2011-09-17 20:17:43 |
Other Links: | manifest | tags |
Context
2011-09-17
| ||
20:22 | Rename OFStream{Poll,Select}Observer to OFStreamObserver_{poll,select}. check-in: 4d2f08f6fe user: js tags: trunk | |
20:17 | Remove +[OFThread sleepForTimeInterval:microseconds:]. check-in: c19b2b5726 user: js tags: trunk | |
19:18 | Make hashes independant of endianess in OF{Float,Double}{Vector,Matrix}. check-in: f3db074478 user: js tags: trunk | |
Changes
Modified src/OFDate.m from [177828d4d1] to [0cf451e330].
︙ | ︙ | |||
371 372 373 374 375 376 377 | [element autorelease]; return element; } - (uint32_t)microsecond { | | | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | [element autorelease]; return element; } - (uint32_t)microsecond { return (uint32_t)nearbyint(remainder(seconds, 1) * 1000000); } - (uint8_t)second { GMTIME_RET(tm_sec) } |
︙ | ︙ |
Modified src/OFThread.h from [94d47672c0] to [f4f9d56218].
︙ | ︙ | |||
162 163 164 165 166 167 168 | /** * \brief Suspends execution of the current thread for the specified time * interval. * * \param seconds The number of seconds to sleep */ | | < < < < < < < < < < | 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | /** * \brief Suspends execution of the current thread for the specified time * interval. * * \param seconds The number of seconds to sleep */ + (void)sleepForTimeInterval: (double)seconds; /** * \brief Suspends execution of the current thread until the specified date. * * \param date The date to wait for */ + (void)sleepUntilDate: (OFDate*)date; |
︙ | ︙ |
Modified src/OFThread.m from [8714631aa6] to [95ced5e160].
︙ | ︙ | |||
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(); |
︙ | ︙ |