if ( work == -1 ) {
break;
}
-//Sys_Printf ("thread %i, work %i\n", threadnum, work);
+ //Sys_Printf ("thread %i, work %i\n", threadnum, work);
workfunction( work );
}
}
#include <windows.h>
-int numthreads = -1;
+// Setting default Threads to 1
+int numthreads = 1;
CRITICAL_SECTION crit;
static int enter;
}
}
+
#include <pthread.h>
pthread_mutex_t *my_mutex;
=======================================================================
*/
-int numthreads = 4;
+// Setting default Threads to 1
+int numthreads = 1;
void ThreadSetDefault( void ){
if ( numthreads == -1 ) { // not set manually
if ( pthread_mutexattr_init( &mattrib ) != 0 ) {
Error( "pthread_mutexattr_init failed" );
}
-#if __GLIBC_MINOR__ == 1
- if ( pthread_mutexattr_settype( &mattrib, PTHREAD_MUTEX_FAST_NP ) != 0 )
-#else
- if ( pthread_mutexattr_settype( &mattrib, PTHREAD_MUTEX_ADAPTIVE_NP ) != 0 )
-#endif
- { Error( "pthread_mutexattr_settype failed" ); }
+ if ( pthread_mutexattr_settype( &mattrib, PTHREAD_MUTEX_ERRORCHECK ) != 0 ) {
+ Error( "pthread_mutexattr_settype failed" );
+ }
recursive_mutex_init( mattrib );
for ( i = 0 ; i < numthreads ; i++ )