MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / cbm_thread_create

Function cbm_thread_create

src/foundation/compat_thread.c:36–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36int cbm_thread_create(cbm_thread_t *t, size_t stack_size, void *(*fn)(void *), void *arg) {
37 if (stack_size == 0) {
38 stack_size = CBM_DEFAULT_STACK_SIZE;
39 }
40 win_thread_arg_t *a = (win_thread_arg_t *)malloc(sizeof(win_thread_arg_t));
41 if (!a) {
42 return CBM_NOT_FOUND;
43 }
44 a->fn = fn;
45 a->arg = arg;
46 t->handle = CreateThread(NULL, stack_size, win_thread_wrapper, a, 0, NULL);
47 if (!t->handle) {
48 free(a);
49 return CBM_NOT_FOUND;
50 }
51 return 0;
52}
53
54int cbm_thread_join(cbm_thread_t *t) {
55 if (WaitForSingleObject(t->handle, INFINITE) != WAIT_OBJECT_0) {

Callers 13

parallel_sort_indexesFunction · 0.85
run_cliFunction · 0.85
mainFunction · 0.85
maybe_auto_indexFunction · 0.85
start_update_checkFunction · 0.85
cbm_diag_startFunction · 0.85
handle_index_startFunction · 0.85
run_pthreadsFunction · 0.85
run_githistoryFunction · 0.85
test_mem.cFile · 0.85
th_server_startFunction · 0.85

Calls

no outgoing calls

Tested by 2

th_server_startFunction · 0.68