comparison src/timer/linux/SDL_systimer.c @ 1:cf2af46e9e2a

Changes since SDL 1.2.0 release
author Sam Lantinga <slouken@lokigames.com>
date Thu, 26 Apr 2001 16:50:19 +0000
parents 74212992fb08
children 39877400bd1e
comparison
equal deleted inserted replaced
0:74212992fb08 1:cf2af46e9e2a
33 #include <errno.h> 33 #include <errno.h>
34 34
35 #include "SDL_error.h" 35 #include "SDL_error.h"
36 #include "SDL_timer.h" 36 #include "SDL_timer.h"
37 #include "SDL_timer_c.h" 37 #include "SDL_timer_c.h"
38
39 #if _POSIX_THREAD_SYSCALL_SOFT
40 #include <pthread.h>
41 #endif
38 42
39 #if defined(DISABLE_THREADS) || defined(FORK_HACK) 43 #if defined(DISABLE_THREADS) || defined(FORK_HACK)
40 #define USE_ITIMER 44 #define USE_ITIMER
41 #endif 45 #endif
42 46
94 then = SDL_GetTicks(); 98 then = SDL_GetTicks();
95 #endif 99 #endif
96 do { 100 do {
97 errno = 0; 101 errno = 0;
98 102
103 #if _POSIX_THREAD_SYSCALL_SOFT
104 pthread_yield_np();
105 #endif
99 #ifdef USE_NANOSLEEP 106 #ifdef USE_NANOSLEEP
100 tv.tv_sec = elapsed.tv_sec; 107 tv.tv_sec = elapsed.tv_sec;
101 tv.tv_nsec = elapsed.tv_nsec; 108 tv.tv_nsec = elapsed.tv_nsec;
102 was_error = nanosleep(&tv, &elapsed); 109 was_error = nanosleep(&tv, &elapsed);
103 #else 110 #else