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

Function cbm_subprocess_request_cancel

src/foundation/subprocess.c:1971–1989  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1969}
1970
1971bool cbm_subprocess_request_cancel(cbm_subprocess_t *process) {
1972 if (!process) {
1973 return false;
1974 }
1975 int lifecycle = atomic_load_explicit(&process->lifecycle, memory_order_acquire);
1976 for (;;) {
1977 if (lifecycle == CBM_SUBPROCESS_CANCEL_REQUESTED) {
1978 return true;
1979 }
1980 if (lifecycle != CBM_SUBPROCESS_ACTIVE) {
1981 return false;
1982 }
1983 int desired = CBM_SUBPROCESS_CANCEL_REQUESTED;
1984 if (atomic_compare_exchange_weak_explicit(&process->lifecycle, &lifecycle, desired,
1985 memory_order_acq_rel, memory_order_acquire)) {
1986 return true;
1987 }
1988 }
1989}
1990
1991void cbm_subprocess_destroy(cbm_subprocess_t *process) {
1992 if (!process || atomic_load_explicit(&process->lifecycle, memory_order_acquire) !=

Callers 15

watcher_git_runFunction · 0.85
cbm_watcher_watchFunction · 0.85
cbm_watcher_unwatchFunction · 0.85
cancel_active_git_entryFunction · 0.85
cbm_watcher_stopFunction · 0.85
gf_run_inputFunction · 0.85
ia_gitFunction · 0.85
if_native_runFunction · 0.85
ordered_log_callbackFunction · 0.85

Calls

no outgoing calls

Tested by 6

gf_run_inputFunction · 0.68
if_native_runFunction · 0.68
ordered_log_callbackFunction · 0.68
sp_stdout_reapFunction · 0.68
sp_stdin_finishFunction · 0.68
rf_waitFunction · 0.68