- Timestamp:
- 08/30/08 11:28:36 (3 months ago)
- Files:
-
- trunk/rebuild/mars.c (modified) (6 diffs)
- trunk/rebuild/rebuild.exe (modified) (previous)
- trunk/rebuild/rebuild_choosedc.exe (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/rebuild/mars.c
r903 r909 21 21 #include <sys/types.h> 22 22 23 #if _WIN32 24 #define PTW32_STATIC_LIB 25 #endif 26 23 #ifndef _WIN32 24 /*#define PTW32_STATIC_LIB*/ 27 25 #include <pthread.h> 26 #endif 28 27 29 28 #if _WIN32 … … 126 125 Array GroupedCompiles; 127 126 unsigned int curcompile = 0; 127 128 #ifndef _WIN32 128 129 pthread_mutex_t compilemutex; 130 #endif 131 129 132 void *compileThread(void *); 130 133 … … 1719 1722 1720 1723 // Now do the actual compilation, across any number of processors 1724 #ifndef _WIN32 1721 1725 if (global.params.procs > 1) { 1722 1726 pthread_t threads[global.params.procs]; … … 1729 1733 pthread_join(threads[j], NULL); 1730 1734 } 1731 } else { 1735 } else 1736 #endif 1737 { 1732 1738 compileThread(NULL); 1733 1739 } … … 1788 1794 void *compileThread(void *ignore) 1789 1795 { 1796 #ifndef _WIN32 1790 1797 pthread_mutex_lock(&compilemutex); 1798 #endif 1791 1799 int tnum = rand(); 1792 1800 while (curcompile < GroupedCompiles.dim) { 1793 1801 GroupedCompile *gc = (GroupedCompile *) GroupedCompiles.data[curcompile]; 1794 1802 curcompile++; 1803 #ifndef _WIN32 1795 1804 pthread_mutex_unlock(&compilemutex); 1805 #endif 1796 1806 1797 1807 if (gc->imodules.dim == 0) { 1808 #ifndef _WIN32 1798 1809 pthread_mutex_lock(&compilemutex); 1810 #endif 1799 1811 continue; 1800 1812 } … … 1844 1856 } 1845 1857 1858 #ifndef _WIN32 1846 1859 pthread_mutex_lock(&compilemutex); 1847 } 1860 #endif 1861 } 1862 #ifndef _WIN32 1848 1863 pthread_mutex_unlock(&compilemutex); 1864 #endif 1849 1865 } 1850 1866
