Changeset 909 for trunk

Show
Ignore:
Timestamp:
08/30/08 11:28:36 (3 months ago)
Author:
Gregor
Message:

rebuild/mars.c: Don't use pthreads on Windows.

rebuild/*.exe: Updated.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/rebuild/mars.c

    r903 r909  
    2121#include <sys/types.h> 
    2222 
    23 #if _WIN32 
    24 #define PTW32_STATIC_LIB 
    25 #endif 
    26  
     23#ifndef _WIN32 
     24/*#define PTW32_STATIC_LIB*/ 
    2725#include <pthread.h> 
     26#endif 
    2827 
    2928#if _WIN32 
     
    126125Array GroupedCompiles; 
    127126unsigned int curcompile = 0; 
     127 
     128#ifndef _WIN32 
    128129pthread_mutex_t compilemutex; 
     130#endif 
     131 
    129132void *compileThread(void *); 
    130133 
     
    17191722     
    17201723    // Now do the actual compilation, across any number of processors 
     1724#ifndef _WIN32 
    17211725    if (global.params.procs > 1) { 
    17221726        pthread_t threads[global.params.procs]; 
     
    17291733            pthread_join(threads[j], NULL); 
    17301734        } 
    1731     } else { 
     1735    } else 
     1736#endif 
     1737    { 
    17321738        compileThread(NULL); 
    17331739    } 
     
    17881794void *compileThread(void *ignore) 
    17891795{ 
     1796#ifndef _WIN32 
    17901797    pthread_mutex_lock(&compilemutex); 
     1798#endif 
    17911799    int tnum = rand(); 
    17921800    while (curcompile < GroupedCompiles.dim) { 
    17931801        GroupedCompile *gc = (GroupedCompile *) GroupedCompiles.data[curcompile]; 
    17941802        curcompile++; 
     1803#ifndef _WIN32 
    17951804        pthread_mutex_unlock(&compilemutex); 
     1805#endif 
    17961806 
    17971807        if (gc->imodules.dim == 0) { 
     1808#ifndef _WIN32 
    17981809            pthread_mutex_lock(&compilemutex); 
     1810#endif 
    17991811            continue; 
    18001812        } 
     
    18441856        } 
    18451857 
     1858#ifndef _WIN32 
    18461859        pthread_mutex_lock(&compilemutex); 
    1847     } 
     1860#endif 
     1861    } 
     1862#ifndef _WIN32 
    18481863    pthread_mutex_unlock(&compilemutex); 
     1864#endif 
    18491865} 
    18501866