Changeset 688 for threadman/trunk
- Timestamp:
- 30/06/08 23:35:45 (2 years ago)
- Location:
- threadman/trunk
- Files:
-
- 2 modified
-
CMakeLists.txt (modified) (1 diff)
-
threadman.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
threadman/trunk/CMakeLists.txt
r685 r688 1 1 CMAKE_MINIMUM_REQUIRED(VERSION 2.4) 2 2 project(threadman) 3 4 OPTION(optimise "Build with optimisations in vanilla make" OFF) 5 if (optimise) 6 SET(CMAKE_BUILD_TYPE Release) 7 else(optimise) 8 SET(CMAKE_BUILD_TYPE Debug) 9 endif(optimise) 3 10 4 11 ENABLE_TESTING() -
threadman/trunk/threadman.cpp
r687 r688 390 390 bail = true; //don't let new stuff get created 391 391 SDL_mutexP(mut); 392 //holding the mutex here is safe -- stop doesn't block 392 393 const SYNCS::iterator e = sync.end(); 393 394 for (SYNCS::iterator it = sync.begin(); it != e; ++it) … … 402 403 stopAll(); 403 404 SDL_mutexP(mut); 404 const SYNCS::iterator e = sync.end(); 405 for (SYNCS::iterator it = sync.begin(); it != e; ++it) { 405 SYNCS local_sync; 406 RSYNCS local_rsync; 407 std::swap(local_sync, sync); 408 std::swap(local_rsync, rsync); 409 SDL_mutexV(mut); 410 411 const SYNCS::iterator e = local_sync.end(); 412 for (SYNCS::iterator it = local_sync.begin(); it != e; ++it) { 406 413 it->second->wait(); 407 414 delete it->second; 408 415 } 409 sync.clear(); 410 const RSYNCS::iterator re = rsync.end(); 411 for (RSYNCS::iterator it = rsync.begin(); it != re; ++it) { 416 const RSYNCS::iterator re = local_rsync.end(); 417 for (RSYNCS::iterator it = local_rsync.begin(); it != re; ++it) { 412 418 (*it)->wait(); 413 419 delete *it; 414 420 } 415 rsync.clear();416 SDL_mutexV(mut);417 421 } 418 422
