When the first finished job arrives, we'll cancel the rest of the tasks
| 143 | |
| 144 | // When the first finished job arrives, we'll cancel the rest of the tasks |
| 145 | static int32_t ProcessCancel(HJobContext ctx, HJob job, void* user_context, void* user_data) |
| 146 | { |
| 147 | ContextCancel* context = (ContextCancel*)user_context; |
| 148 | dmAtomicIncrement32(&context->m_NumProcessed); |
| 149 | |
| 150 | uint64_t t = (uint64_t)(uintptr_t)user_data; |
| 151 | |
| 152 | for (uint32_t i = 0; i < context->m_JobsToCancel.Size(); ++i) |
| 153 | { |
| 154 | JobSystemCancelJob(ctx, context->m_JobsToCancel[i]); |
| 155 | } |
| 156 | |
| 157 | dmTime::Sleep(t); |
| 158 | return 1; |
| 159 | } |
| 160 | |
| 161 | static void CallbackCancel(HJobContext ctx, HJob job, JobSystemStatus status, void* user_context, void* user_data, int32_t user_result) |
| 162 | { |
nothing calls this directly
no test coverage detected