summaryrefslogtreecommitdiff
path: root/kern/thread_i.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2017-02-14 20:43:38 +0100
committerRichard Braun <rbraun@sceen.net>2017-02-14 20:43:38 +0100
commit9391ff21c546aad1f2ac0054c92d817591b2d5ae (patch)
treee20783f1c2d1a603ac6192bb30f703406c76681a /kern/thread_i.h
parentbd8cf49f471162fa2a5d5556014aeafae4cff644 (diff)
kern/thread: add reference counter
Counting thread references seems unavoidable for the near-future changes that are currently brewing.
Diffstat (limited to 'kern/thread_i.h')
-rw-r--r--kern/thread_i.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/kern/thread_i.h b/kern/thread_i.h
index b3d09a05..a062773d 100644
--- a/kern/thread_i.h
+++ b/kern/thread_i.h
@@ -80,6 +80,9 @@ struct thread_fs_data {
struct thread {
struct tcb tcb;
+ /* Reference counter, must be changed atomically */
+ unsigned long nr_refs;
+
/* Flags must be changed atomically */
unsigned long flags;
@@ -130,6 +133,8 @@ struct thread {
#define THREAD_ATTR_DETACHED 0x1
+void thread_destroy(struct thread *thread);
+
/*
* Flag access functions.
*/