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

Function cbm_watcher_unwatch

src/watcher/watcher.c:1229–1250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1227}
1228
1229void cbm_watcher_unwatch(cbm_watcher_t *w, const char *project_name) {
1230 if (!w || !project_name) {
1231 return;
1232 }
1233 bool removed = false;
1234 cbm_mutex_lock(&w->projects_lock);
1235 project_state_t *s = cbm_ht_get(w->projects, project_name);
1236 if (s && defer_state_free(w, s)) {
1237 /* The entry leaves the table only once its state is safely on
1238 * the deferred-free list; on OOM the watch stays registered. */
1239 atomic_store_explicit(&s->registered, false, memory_order_release);
1240 if (s->active_git) {
1241 (void)cbm_subprocess_request_cancel(s->active_git);
1242 }
1243 cbm_ht_delete(w->projects, project_name);
1244 removed = true;
1245 }
1246 cbm_mutex_unlock(&w->projects_lock);
1247 if (removed) {
1248 cbm_log_info("watcher.unwatch", "project", project_name);
1249 }
1250}
1251
1252void cbm_watcher_touch(cbm_watcher_t *w, const char *project_name) {
1253 if (!w || !project_name) {

Callers 7

handle_delete_projectFunction · 0.85
unwatch_projectFunction · 0.85
test_watcher.cFile · 0.85
test_httpd.cFile · 0.85

Calls 6

cbm_mutex_lockFunction · 0.85
cbm_ht_getFunction · 0.85
defer_state_freeFunction · 0.85
cbm_ht_deleteFunction · 0.85
cbm_mutex_unlockFunction · 0.85

Tested by 1