/*
- Copyright (C) 1999-2006 Id Software, Inc. and contributors.
+ Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef WIN32
+#include "globaldefs.h"
+#if !GDEF_OS_WINDOWS
// The below define is necessary to use
// pthreads extensions like pthread_mutexattr_settype
#define _GNU_SOURCE
===================================================================
*/
-#ifdef WIN32
+#if GDEF_OS_WINDOWS
#define USED
=======================================================================
*/
-#if defined( __linux__ ) || ( defined( __APPLE__ ) && !MAC_STATIC_HACK )
+#if GDEF_OS_LINUX || ( GDEF_OS_MACOS && !MAC_STATIC_HACK )
#define USED
#include <unistd.h>
size_t stacksize;
int start, end;
- int i = 0, status = 0;
+ int i = 0;
start = I_FloatTime();
pacifier = showpacifier;
for ( i = 0 ; i < numthreads ; i++ )
{
/* Default pthread attributes: joinable & non-realtime scheduling */
- if ( pthread_create( &work_threads[i], &attr, (void*)func, (void*)(size_t)i ) != 0 ) {
+ if (pthread_create(&work_threads[i], &attr, (void *(*)(void *)) func, (void*)(size_t)i ) != 0 ) {
Error( "pthread_create failed" );
}
}
for ( i = 0 ; i < numthreads ; i++ )
{
- if ( pthread_join( work_threads[i], (void **)&status ) != 0 ) {
+ if ( pthread_join( work_threads[i], NULL ) != 0 ) {
Error( "pthread_join failed" );
}
}
=============
*/
void RunThreadsOn( int workcnt, qboolean showpacifier, void ( *func )( int ) ){
- int i;
int start, end;
dispatch = 0;