From 0818d96c97ceec4dbb8251c5220a2fdcdf39f355 Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Sat, 24 Apr 1999 00:12:00 +0000 Subject: A lot of cleanups... Removed old thread-safe code and other redundant code and files --- php3_threads.c | 79 ---------------------------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 php3_threads.c (limited to 'php3_threads.c') diff --git a/php3_threads.c b/php3_threads.c deleted file mode 100644 index 6218f8fe67..0000000000 --- a/php3_threads.c +++ /dev/null @@ -1,79 +0,0 @@ -#include -#include "alloc.h" -#include -#if (WIN32|WINNT) -#include -#else -#include -#endif -#include "php3_threads.h" - -/* Function for allocating memory for mutexes */ -static void *php3_mutex_alloc( void ) -{ - MUTEX_T *mutexp; - /* Allocate memory for the mutex and initialize it */ - if ( (mutexp = emalloc( sizeof(MUTEX_T) )) != NULL ) { - MUTEX_INIT( mutexp, NULL ); - } - return( mutexp ); -} - -/* Function for freeing mutexes */ -static void php3_mutex_free( void *mutexp ) -{ - MUTEX_DESTROY( (MUTEX_T *) mutexp ); -} - -static void php3_mutex_lock( void *mutexp ) -{ - return MUTEX_LOCK(mutexp); -} - -static void php3_mutex_unlock( void *mutexp ) -{ - return MUTEX_UNLOCK(mutexp); -} - -/* Function for setting up thread-specific data */ -/* should be called at thread start */ -int php3_tls_init(void *key,void *tsd,int size) -{ - /* Check if thread-specific data already exists */ - tsd = TLS_GET_DATA( key ); - if ( tsd != NULL ) { - /*FIXME what kind of output here? */ - fprintf( stderr, "php3_tls_setup tls var non-null!\n" ); - THREAD_EXIT( NULL ); - } - /* Allocate memory for the LDAP error values */ - tsd = (void *) ecalloc( 1, size ); - /* Make the data specific to the calling thread */ - TLS_SET_DATA( key, tsd ); -} - -/*should be called before thread exit*/ -int php3_tls_free(void *key, void *tsd) -{ - if (tsd)efree(tsd); -} - -/*should be called at dl or process startup*/ -int php3_tls_startup(void *key) -{ - if (key == NULL){ - if (TLS_ALLOC(key)==TLS_NOT_ALLOCED) - return 0; - } - return 1; -} - -/*should be called before dl or process exit*/ -int php3_tls_shutdown(void *key) -{ - if (key != NULL){ - if (!TLS_FREE(key)) - return 0; - } - return 1; -} \ No newline at end of file -- cgit v1.2.1