Commit fa3092a1 authored by Philippe Gerum's avatar Philippe Gerum

copperplate/semobj: add uninit cleanup helper

This one does not run the object finalizer, assuming a strictly
passive object (no waiters yet).
parent 033976af
......@@ -66,6 +66,8 @@ int semobj_init(struct semobj *smobj,
int semobj_destroy(struct semobj *smobj);
void semobj_uninit(struct semobj *smobj);
int semobj_post(struct semobj *smobj);
int semobj_broadcast(struct semobj *smobj);
......
......@@ -73,6 +73,13 @@ int semobj_destroy(struct semobj *smobj)
return ret;
}
void semobj_uninit(struct semobj *smobj)
{
int ret = __RT(sem_destroy(&smobj->core.sem));
assert(ret == 0);
(void)ret;
}
int semobj_post(struct semobj *smobj)
{
int ret;
......@@ -217,6 +224,11 @@ int semobj_destroy(struct semobj *smobj)
return syncobj_destroy(&smobj->core.sobj, &syns);
}
void semobj_uninit(struct semobj *smobj)
{
syncobj_uninit(&smobj->core.sobj);
}
int semobj_post(struct semobj *smobj)
{
struct syncstate syns;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment