Fixed building with pthreads and the pth library

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40416
This commit is contained in:
Sam Lantinga 2002-06-13 21:36:25 +00:00
parent 151ff4a5c6
commit 9d7dc6149a
2 changed files with 18 additions and 6 deletions

View file

@ -41,6 +41,9 @@ static char rcsid =
#if _POSIX_THREAD_SYSCALL_SOFT
#include <pthread.h>
#endif
#ifdef ENABLE_PTH
#include <pth.h>
#endif
#if defined(DISABLE_THREADS) || defined(FORK_HACK)
#define USE_ITIMER
@ -142,6 +145,12 @@ Uint32 SDL_GetTicks (void)
void SDL_Delay (Uint32 ms)
{
#ifdef ENABLE_PTH
pth_time_t tv;
tv.tv_sec = ms/1000;
tv.tv_usec = (ms%1000)*1000;
pth_nap(tv);
#else
int was_error;
#ifdef USE_NANOSLEEP
@ -189,6 +198,7 @@ void SDL_Delay (Uint32 ms)
was_error = select(0, NULL, NULL, NULL, &tv);
#endif /* USE_NANOSLEEP */
} while ( was_error && (errno == EINTR) );
#endif /* ENABLE_PTH */
}
#ifdef USE_ITIMER