From 5749f1d8fe80cbb84d66a265bcf9bafe159985ab Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Tue, 6 Nov 2007 10:41:14 +0000 Subject: Rename source files in an ot_ fashion --- mutex.c | 77 -------------------------------------------------------------- mutex.h | 13 ----------- ot_mutex.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ot_mutex.h | 13 +++++++++++ 4 files changed, 90 insertions(+), 90 deletions(-) delete mode 100644 mutex.c delete mode 100644 mutex.h create mode 100644 ot_mutex.c create mode 100644 ot_mutex.h diff --git a/mutex.c b/mutex.c deleted file mode 100644 index 5c14e45..0000000 --- a/mutex.c +++ /dev/null @@ -1,77 +0,0 @@ -/* This software was written by Dirk Engling - It is considered beerware. Prost. Skol. Cheers or whatever. */ - -#include -#include - -#include "trackerlogic.h" -#include "mutex.h" - -static int bucket_locklist[ OT_MAX_THREADS ]; -static int bucket_locklist_count = 0; -static pthread_mutex_t bucket_mutex; -static pthread_cond_t bucket_being_unlocked; - -static int bucket_check( int bucket ) { - /* C should come with auto-i ;) */ - int i; - - /* No more space to acquire lock to bucket -- should not happen */ - if( bucket_locklist_count == OT_MAX_THREADS ) { - fprintf( stderr, "More lock requests than mutexes. Consult source code.\n" ); - return -1; - } - - /* See, if bucket is already locked */ - for( i=0; i - It is considered beerware. Prost. Skol. Cheers or whatever. */ - -#ifndef __MUTEX_H__ -#define __MUTEX_H__ - -void mutex_init( ); -void mutex_deinit( ); - -void mutex_bucket_lock( int bucket ); -void mutex_bucket_unlock( int bucket ); - -#endif diff --git a/ot_mutex.c b/ot_mutex.c new file mode 100644 index 0000000..5c14e45 --- /dev/null +++ b/ot_mutex.c @@ -0,0 +1,77 @@ +/* This software was written by Dirk Engling + It is considered beerware. Prost. Skol. Cheers or whatever. */ + +#include +#include + +#include "trackerlogic.h" +#include "mutex.h" + +static int bucket_locklist[ OT_MAX_THREADS ]; +static int bucket_locklist_count = 0; +static pthread_mutex_t bucket_mutex; +static pthread_cond_t bucket_being_unlocked; + +static int bucket_check( int bucket ) { + /* C should come with auto-i ;) */ + int i; + + /* No more space to acquire lock to bucket -- should not happen */ + if( bucket_locklist_count == OT_MAX_THREADS ) { + fprintf( stderr, "More lock requests than mutexes. Consult source code.\n" ); + return -1; + } + + /* See, if bucket is already locked */ + for( i=0; i + It is considered beerware. Prost. Skol. Cheers or whatever. */ + +#ifndef __MUTEX_H__ +#define __MUTEX_H__ + +void mutex_init( ); +void mutex_deinit( ); + +void mutex_bucket_lock( int bucket ); +void mutex_bucket_unlock( int bucket ); + +#endif -- cgit v1.2.3