summaryrefslogtreecommitdiff
path: root/kern/sref_i.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-01-10 23:43:32 +0100
committerRichard Braun <rbraun@sceen.net>2018-01-10 23:43:32 +0100
commita80b56b8b39f5c23b34f88fda0c936c61372b4ba (patch)
tree998d5b656f3e45bde44c63d7555fde363d1787ed /kern/sref_i.h
parentf53f4cef543c0f1195811edae18e716fb145faf7 (diff)
parent21e4ae378ff6bbf22fe03eb5eaa51caa9750a7ee (diff)
Merge branch 'sref_rework'
Diffstat (limited to 'kern/sref_i.h')
-rw-r--r--kern/sref_i.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/kern/sref_i.h b/kern/sref_i.h
index 5b63857f..09dbbfa8 100644
--- a/kern/sref_i.h
+++ b/kern/sref_i.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014-2017 Richard Braun.
+ * Copyright (c) 2014-2018 Richard Braun.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +20,7 @@
#include <stdint.h>
+#include <kern/slist.h>
#include <kern/spinlock.h>
#include <kern/work.h>
@@ -44,15 +45,17 @@ struct sref_weakref {
/*
* Scalable reference counter.
*
- * It's tempting to merge the flags into the next member, but since they're
+ * It's tempting to merge the flags into the node member, but since they're
* not protected by the same lock, store them separately.
+ *
+ * TODO Locking keys.
*/
struct sref_counter {
sref_noref_fn_t noref_fn;
union {
struct {
- struct sref_counter *next;
+ struct slist_node node;
struct spinlock lock;
int flags;
unsigned long value;