| 285 | } |
| 286 | |
| 287 | JobSystemResult JobSystemPushJob(HJobContext context, HJob hjob) |
| 288 | { |
| 289 | if (dmAtomicGet32(&context->m_Initialized) == 0) |
| 290 | { |
| 291 | return JOBSYSTEM_RESULT_ERROR; |
| 292 | } |
| 293 | |
| 294 | JobThreadContext* ctx = &context->m_ThreadContext; |
| 295 | |
| 296 | JobSystemStatus status = PutWork(ctx, hjob); |
| 297 | if (status == JOBSYSTEM_STATUS_CANCELED) |
| 298 | return JOBSYSTEM_RESULT_CANCELED; |
| 299 | |
| 300 | #if defined(DM_HAS_THREADS) |
| 301 | if (ctx->m_WakeupCond) |
| 302 | { |
| 303 | dmConditionVariable::Signal(ctx->m_WakeupCond); |
| 304 | } |
| 305 | #endif |
| 306 | |
| 307 | return JOBSYSTEM_RESULT_OK; |
| 308 | } |
| 309 | |
| 310 | void* JobSystemGetContext(HJobContext context, HJob hjob) |
| 311 | { |