Overview
| Comment: | Use Sleep(0) instead of yield() on Win32. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
eb827e8f21295fe42a772dc4047c00fd |
| User & Date: | js on 2011-03-17 20:33:57 |
| Other Links: | manifest | tags |
Context
|
2011-03-21
| ||
| 12:43 | Don't depend on objc/objc.h for compiler checks. (check-in: 4c598e07ad user: js tags: trunk) | |
|
2011-03-17
| ||
| 20:33 | Use Sleep(0) instead of yield() on Win32. (check-in: eb827e8f21 user: js tags: trunk) | |
|
2011-03-11
| ||
| 16:47 | Get rid of warnings when using latest clang. (check-in: 36c4b260aa user: js tags: trunk) | |
Changes
Modified src/threading.h from [33ef5dc30b] to [ad9f8119e0].
| ︙ | ︙ | |||
307 308 309 310 311 312 313 |
#endif
}
static OF_INLINE BOOL
of_spinlock_lock(of_spinlock_t *s)
{
#if defined(OF_ATOMIC_OPS)
| | > > > > | 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
#endif
}
static OF_INLINE BOOL
of_spinlock_lock(of_spinlock_t *s)
{
#if defined(OF_ATOMIC_OPS)
# if defined(OF_HAVE_SCHED_YIELD) || defined(_WIN32)
int i;
for (i = 0; i < OF_SPINCOUNT; i++)
if (of_spinlock_trylock(s))
return YES;
while (!of_spinlock_trylock(s))
# ifndef _WIN32
sched_yield();
# else
Sleep(0);
# endif
# else
while (!of_spinlock_trylock(s));
# endif
return YES;
#elif defined(OF_HAVE_PTHREAD_SPINLOCKS)
return (pthread_spin_lock(s) ? NO : YES);
|
| ︙ | ︙ |