Mercurial > sdl-ios-xcode
diff src/thread/linux/SDL_syssem.c @ 1300:fd068ab116ee
Removed some old Mac OS X cruft.
Fixes Bugzilla #64.
--ryan.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Mon, 30 Jan 2006 18:56:30 +0000 |
parents | b8d311d90021 |
children | c9b51268668f |
line wrap: on
line diff
--- a/src/thread/linux/SDL_syssem.c Mon Jan 30 18:21:44 2006 +0000 +++ b/src/thread/linux/SDL_syssem.c Mon Jan 30 18:56:30 2006 +0000 @@ -61,8 +61,6 @@ #ifdef MACOSX #define USE_NAMED_SEMAPHORES -/* Broken sem_getvalue() in MacOS X Public Beta */ -#define BROKEN_SEMGETVALUE #endif /* MACOSX */ struct SDL_semaphore { @@ -70,12 +68,6 @@ #ifndef USE_NAMED_SEMAPHORES sem_t sem_data; #endif -#ifdef BROKEN_SEMGETVALUE - /* This is a little hack for MacOS X - - It's not thread-safe, but it's better than nothing - */ - int sem_value; -#endif }; /* Create a semaphore, initialized with value */ @@ -105,12 +97,6 @@ sem->sem = &sem->sem_data; } #endif /* USE_NAMED_SEMAPHORES */ - -#ifdef BROKEN_SEMGETVALUE - if ( sem ) { - sem->sem_value = initial_value; - } -#endif /* BROKEN_SEMGETVALUE */ } else { SDL_OutOfMemory(); } @@ -139,9 +125,6 @@ } retval = SDL_MUTEX_TIMEDOUT; if ( sem_trywait(sem->sem) == 0 ) { -#ifdef BROKEN_SEMGETVALUE - --sem->sem_value; -#endif retval = 0; } return retval; @@ -156,9 +139,6 @@ return -1; } -#ifdef BROKEN_SEMGETVALUE - --sem->sem_value; -#endif retval = sem_wait(sem->sem); if ( retval < 0 ) { SDL_SetError("sem_wait() failed"); @@ -200,11 +180,7 @@ { int ret = 0; if ( sem ) { -#ifdef BROKEN_SEMGETVALUE - ret = sem->sem_value; -#else sem_getvalue(sem->sem, &ret); -#endif if ( ret < 0 ) { ret = 0; } @@ -221,9 +197,6 @@ return -1; } -#ifdef BROKEN_SEMGETVALUE - ++sem->sem_value; -#endif retval = sem_post(sem->sem); if ( retval < 0 ) { SDL_SetError("sem_post() failed");