| 180 | } |
| 181 | |
| 182 | static void removeThread(Thread* thread) |
| 183 | { |
| 184 | ThreadManager &manager = *ManagedSingleton< ThreadManager >::instance(); |
| 185 | manager.poolLock.lock(); |
| 186 | |
| 187 | U32 threadID = thread->getId(); |
| 188 | for(U32 i = 0;i < manager.threadPool.size();++i) |
| 189 | { |
| 190 | if( compare( manager.threadPool[i]->getId(), threadID ) ) |
| 191 | { |
| 192 | manager.threadPool.erase(i); |
| 193 | break; |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | manager.poolLock.unlock(); |
| 198 | } |
| 199 | |
| 200 | /// Searches the pool of known threads for a thread whose id is equivalent to |
| 201 | /// the given threadid. Compares thread ids with ThreadManager::compare(). |