Mercurial > sdl-ios-xcode
comparison src/timer/unix/SDL_systimer.c @ 1383:1736c5e2173f
NetBSD support
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 20 Feb 2006 03:57:03 +0000 |
parents | 19418e4422cb |
children | d910939febfa |
comparison
equal
deleted
inserted
replaced
1382:b34d38f76a2a | 1383:1736c5e2173f |
---|---|
39 #include <time.h> | 39 #include <time.h> |
40 #endif | 40 #endif |
41 | 41 |
42 #if SDL_THREAD_PTH | 42 #if SDL_THREAD_PTH |
43 #include <pth.h> | 43 #include <pth.h> |
44 #elif _POSIX_THREAD_SYSCALL_SOFT | |
45 #include <pthread.h> | |
46 #endif | 44 #endif |
47 | 45 |
48 #if SDL_THREADS_DISABLED | 46 #if SDL_THREADS_DISABLED |
49 #define USE_ITIMER | 47 #define USE_ITIMER |
50 #endif | 48 #endif |
109 then = SDL_GetTicks(); | 107 then = SDL_GetTicks(); |
110 #endif | 108 #endif |
111 do { | 109 do { |
112 errno = 0; | 110 errno = 0; |
113 | 111 |
114 #if _POSIX_THREAD_SYSCALL_SOFT | |
115 pthread_yield_np(); | |
116 #endif | |
117 #if HAVE_NANOSLEEP | 112 #if HAVE_NANOSLEEP |
118 tv.tv_sec = elapsed.tv_sec; | 113 tv.tv_sec = elapsed.tv_sec; |
119 tv.tv_nsec = elapsed.tv_nsec; | 114 tv.tv_nsec = elapsed.tv_nsec; |
120 was_error = nanosleep(&tv, &elapsed); | 115 was_error = nanosleep(&tv, &elapsed); |
121 #else | 116 #else |