/* 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