diff options
Diffstat (limited to 'include/kpl/object.h')
| -rw-r--r-- | include/kpl/object.h | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/include/kpl/object.h b/include/kpl/object.h index 1053348..b7b1a33 100644 --- a/include/kpl/object.h +++ b/include/kpl/object.h @@ -6,7 +6,8 @@ typedef enum : uint8_t { KPL_OBJECT_FLAGS_EMPTY = 0, - KPL_OBJECT_FLAGS_IO_PENDING = 1 << 0 // When io pending tasks will not be reachable by GC + KPL_OBJECT_FLAGS_IO_PENDING = 1 << 0, // When io pending tasks will not be reachable by GC + KPL_OBJECT_FLAGS_GC_PERSIST = 1 << 1 // Object is never swept by GC until program end } kpl_object_flags; // for atomic linked list queue @@ -84,16 +85,3 @@ typedef struct _kpl_object_task { kpl_result result; kpl_class variables[]; // a task has no distinction between an argument or a local, both live here } kpl_object_task; - -/* - * KPL Object Mutex is a queue of tasks on an object - * Adding: Increment counter, then add task to task queue - * Removing: Remove from task queue, run task, then decrement counter - * Requires spin check when removing task due to space between counter adding and task adding - * If the counter value before was zero take control of the mutex - * The thread that controls the mutex runs each task until counter is zero - */ -typedef struct { - _Atomic int32_t lock_counter; - kpl_object_queue task_queue; -} kpl_object_mutex; |
