changeset 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 2bf9dda618e5
children a78446e47413
files src/thread/linux/SDL_syssem.c src/thread/linux/SDL_systhread.c
diffstat 2 files changed, 0 insertions(+), 31 deletions(-) [+]
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");
--- a/src/thread/linux/SDL_systhread.c	Mon Jan 30 18:21:44 2006 +0000
+++ b/src/thread/linux/SDL_systhread.c	Mon Jan 30 18:56:30 2006 +0000
@@ -61,13 +61,11 @@
 
 #include <signal.h>
 
-#if !defined(MACOSX) /* pthread_sigmask seems to be missing on MacOS X? */
 /* List of signals to mask in the subthreads */
 static int sig_list[] = {
 	SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
 	SIGVTALRM, SIGPROF, 0
 };
-#endif /* !MACOSX */
 
 #ifdef SDL_USE_PTHREADS
 
@@ -102,7 +100,6 @@
 
 void SDL_SYS_SetupThread(void)
 {
-#if !defined(MACOSX) /* pthread_sigmask seems to be missing on MacOS X? */
 	int i;
 	sigset_t mask;
 
@@ -112,7 +109,6 @@
 		sigaddset(&mask, sig_list[i]);
 	}
 	pthread_sigmask(SIG_BLOCK, &mask, 0);
-#endif /* !MACOSX */
 
 #ifdef PTHREAD_CANCEL_ASYNCHRONOUS
 	/* Allow ourselves to be asynchronously cancelled */