| 78 | static unsigned __stdcall part_a_worker(void * raw) |
| 79 | #else |
| 80 | static void * part_a_worker(void * raw) |
| 81 | #endif |
| 82 | { |
| 83 | part_a_args * args = (part_a_args *)raw; |
| 84 | |
| 85 | // Bind the main thread's environment on this worker thread. |
| 86 | das_environment_set_bound(args->env); |
| 87 | |
| 88 | // Look up the function in the *cloned* context. |
| 89 | das_function * fn = das_context_find_function(args->ctx, "compute"); |
| 90 | if (fn) { |
| 91 | vec4f res = das_context_eval_with_catch(args->ctx, fn, NULL); |
| 92 | args->result = das_argument_int(res); |
| 93 | } |
| 94 | |
| 95 | #ifdef _WIN32 |
| 96 | return 0; |
| 97 | #else |
| 98 | return NULL; |
| 99 | #endif |
| 100 | } |
| 101 | |
| 102 | static void part_a_run_on_thread(void) { |
| 103 | printf("=== Part A: Run on a worker thread ===\n"); |
nothing calls this directly
no test coverage detected