| 214 | } |
| 215 | |
| 216 | Tr2RenderContext* Tr2RenderContext::Fork() |
| 217 | { |
| 218 | while( true ) |
| 219 | { |
| 220 | m_parallelContextSemaphore.Wait(); |
| 221 | |
| 222 | CcpAutoMutex lock( m_parallelContextMutex ); |
| 223 | |
| 224 | if( m_parallelContextsPool.empty() ) |
| 225 | { |
| 226 | continue; |
| 227 | } |
| 228 | |
| 229 | auto ctx = m_parallelContextsPool.back(); |
| 230 | m_parallelContextsPool.pop_back(); |
| 231 | return ctx.Detach(); |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | void Tr2RenderContext::Join( Tr2RenderContext* context ) |
| 236 | { |
no test coverage detected