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

Function cbm_thread_create

src/foundation/compat_thread.c:132–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

130}
131
132int cbm_thread_create(cbm_thread_t *t, size_t stack_size, void *(*fn)(void *), void *arg) {
133 if (stack_size == 0) {
134 stack_size = cbm_thread_default_stack_size();
135 } else {
136 stack_size = cbm_thread_stack_floor(stack_size);
137 }
138 win_thread_arg_t *a = (win_thread_arg_t *)malloc(sizeof(win_thread_arg_t));
139 if (!a) {
140 return CBM_NOT_FOUND;
141 }
142 a->fn = fn;
143 a->arg = arg;
144 t->handle = CreateThread(NULL, stack_size, win_thread_wrapper, a, 0, NULL);
145 if (!t->handle) {
146 free(a);
147 return CBM_NOT_FOUND;
148 }
149 return 0;
150}
151
152int cbm_thread_join(cbm_thread_t *t) {
153 if (WaitForSingleObject(t->handle, INFINITE) != WAIT_OBJECT_0) {

Callers 15

parallel_sort_indexesFunction · 0.85
maybe_auto_indexFunction · 0.85
cbm_test_impact_runFunction · 0.85
cbm_test_impact_publishFunction · 0.85
cbm_diag_startFunction · 0.85
handle_index_startFunction · 0.85

Calls 2

cbm_thread_stack_floorFunction · 0.85

Tested by 11

cbm_test_impact_runFunction · 0.68
cbm_test_impact_publishFunction · 0.68
frontend_eof_child_runFunction · 0.68
th_server_thread_startFunction · 0.68
racing_sweep_hookFunction · 0.68
tp_extract_small_stackFunction · 0.68
ov_independent_callsFunction · 0.68
app_async_call_startFunction · 0.68