Ticket #2067: 2067.1.patch
File 2067.1.patch, 1.3 KB (added by , 13 years ago) |
---|
-
thread.hpp
old new 530 530 } 531 531 } 532 532 533 533 void join_all() 534 534 { 535 boost::lock_guard<mutex> guard(m); 536 537 for(std::list<thread*>::iterator it=threads.begin(),end=threads.end(); 538 it!=end; 539 ++it) 535 std::list<thread*> joined; 536 for(;;) 540 537 { 541 (*it)->join(); 538 thread* t; // thread to join while mutex not held 539 { 540 boost::lock_guard<mutex> guard(m); 541 542 for(std::list<thread*>::iterator it=threads.begin(),end=threads.end();;++it) 543 { 544 if(it=end) 545 { 546 return; 547 } 548 std::list<thread*>::iterator const j=std::find(joined.begin(),joined.end(),*it); 549 if(j==joined.end()) 550 { 551 t = *it; 552 break; 553 } 554 } 555 } 556 t->join(); 542 557 } 543 558 } 544 559 545 560 void interrupt_all() 546 561 {