Cleanup syscalls
All checks were successful
Build documentation / build-and-deploy (push) Successful in 34s

This commit is contained in:
2026-01-27 17:34:43 +01:00
parent b388b30b24
commit cf51600c6a
12 changed files with 49 additions and 152 deletions

View File

@@ -42,7 +42,6 @@ struct proc_resource* proc_create_resource_mutex (struct procgroup* procgroup, i
resource->u.mutex.resource = resource;
resource->rid = rid;
resource->type = PR_MUTEX;
resource->refs = 1;
spin_lock (&procgroup->lock, &ctxpg);
rbtree_insert (struct proc_resource, &procgroup->resource_tree, &resource->resource_tree_link,
@@ -52,9 +51,7 @@ struct proc_resource* proc_create_resource_mutex (struct procgroup* procgroup, i
return resource;
}
void proc_resource_unlink (struct proc_resource* resource) {
if (atomic_fetch_sub (&resource->refs, 1) == 1) {
resource->ops.cleanup (resource);
free (resource);
}
void proc_delete_resource (struct proc_resource* resource) {
resource->ops.cleanup (resource);
free (resource);
}