| 97 | } |
| 98 | |
| 99 | void ThreadPoolService::Dispose() |
| 100 | { |
| 101 | // Set exit flag and wake up threads |
| 102 | Platform::AtomicStore(&ThreadPoolImpl::ExitFlag, 1); |
| 103 | ThreadPoolImpl::JobsSignal.NotifyAll(); |
| 104 | |
| 105 | // Wait some time |
| 106 | Platform::Sleep(10); |
| 107 | |
| 108 | // Delete threads |
| 109 | for (int32 i = 0; i < ThreadPoolImpl::Threads.Count(); i++) |
| 110 | { |
| 111 | ThreadPoolImpl::Threads[i]->Kill(true); |
| 112 | } |
| 113 | ThreadPoolImpl::Threads.ClearDelete(); |
| 114 | } |
| 115 | |
| 116 | int32 ThreadPool::ThreadProc() |
| 117 | { |
nothing calls this directly
no test coverage detected