| 78 | |
| 79 | |
| 80 | void DestroyThreadPool(ThreadPool *Pool) |
| 81 | { |
| 82 | CriticalSectionStart(&PoolCreateSync.CritSection); |
| 83 | |
| 84 | if (Pool!=NULL && Pool==GlobalPool && GlobalPoolUseCount > 0 && --GlobalPoolUseCount == 0) |
| 85 | delete GlobalPool; |
| 86 | #ifdef RARDLL |
| 87 | // To correctly work in multithreaded environment UnRAR.dll creates |
| 88 | // new pools if global pool is already in use. We delete such pools here. |
| 89 | if (Pool!=NULL && Pool!=GlobalPool) |
| 90 | delete Pool; |
| 91 | #endif |
| 92 | |
| 93 | CriticalSectionEnd(&PoolCreateSync.CritSection); |
| 94 | } |
| 95 | |
| 96 | |
| 97 | static THREAD_HANDLE ThreadCreate(NATIVE_THREAD_PTR Proc,void *Data) |
no test coverage detected