Skip to content

armgit / facex

Public Imported from GitHub
0

Full face stack that runs entirely in the browser. Detection, 576-point 3D mesh, recognition, anti-spoof, smile — all WebAssembly, zero server. Apache 2.0.

508 B
Raw Blame
/*
 * threadpool_stub.c — Single-threaded stub for WASM build.
 * All work runs sequentially on the main thread.
 */

typedef void (*tp_task_fn)(void* ctx, int start, int end);

void tp_init(int n_threads) {
    (void)n_threads;
}

void tp_parallel_for(tp_task_fn fn, void* ctx, int total, int grain) {
    if (grain <= 0) grain = 1;
    for (int i = 0; i < total; i += grain) {
        int end = i + grain;
        if (end > total) end = total;
        fn(ctx, i, end);
    }
}

void tp_shutdown(void) {}