ソースを参照

fix reentrant mutex

David Rose 17 年 前
コミット
39b6637f93
1 ファイル変更2 行追加2 行削除
  1. 2 2
      panda/src/gobj/vertexDataPage.cxx

+ 2 - 2
panda/src/gobj/vertexDataPage.cxx

@@ -196,6 +196,7 @@ flush_threads() {
 
 
   if (thread_mgr != (PageThreadManager *)NULL) {
   if (thread_mgr != (PageThreadManager *)NULL) {
     thread_mgr->stop_threads();
     thread_mgr->stop_threads();
+    MutexHolder holder(_tlock);
     thread_mgr->start_threads(num_threads);
     thread_mgr->start_threads(num_threads);
   }
   }
 }
 }
@@ -794,11 +795,10 @@ get_num_pending_writes() const {
 //     Function: VertexDataPage::PageThreadManager::start_threads
 //     Function: VertexDataPage::PageThreadManager::start_threads
 //       Access: Public
 //       Access: Public
 //  Description: Adds the indicated of threads to the list of active
 //  Description: Adds the indicated of threads to the list of active
-//               threads.  Assumes _tlock is *not* held.
+//               threads.  Assumes _tlock is held.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void VertexDataPage::PageThreadManager::
 void VertexDataPage::PageThreadManager::
 start_threads(int num_threads) {
 start_threads(int num_threads) {
-  MutexHolder holder(_tlock);
   _shutdown = false;
   _shutdown = false;
 
 
   _threads.reserve(num_threads);
   _threads.reserve(num_threads);