aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/_rmlock.h
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2019-12-27 11:19:57 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2019-12-27 11:19:57 +0000
commit1f162fef76a04af66a7cec59a84a4adf7d2000c6 (patch)
treee5156cdc174e15c785048493851fc19540d0142c /sys/sys/_rmlock.h
parente99c4e4d6449626eda1934a2bdb80ab80621c8a6 (diff)
downloadsrc-1f162fef76a04af66a7cec59a84a4adf7d2000c6.tar.gz
src-1f162fef76a04af66a7cec59a84a4adf7d2000c6.zip
Add read-mostly sleepable locks
To be used when like rmlocks, except when sleeping for readers needs to be allowed. See the manpage for more information. Reviewed by: kib (previous version) Differential Revision: https://reviews.freebsd.org/D22823
Notes
Notes: svn path=/head/; revision=356119
Diffstat (limited to 'sys/sys/_rmlock.h')
-rw-r--r--sys/sys/_rmlock.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/sys/_rmlock.h b/sys/sys/_rmlock.h
index 89a25ee68798..68ddc3b3fb03 100644
--- a/sys/sys/_rmlock.h
+++ b/sys/sys/_rmlock.h
@@ -68,4 +68,14 @@ struct rm_priotracker {
LIST_ENTRY(rm_priotracker) rmp_qentry;
};
+#include <sys/_mutex.h>
+
+struct rmslock {
+ struct mtx mtx;
+ int writers;
+ int readers;
+ int *readers_pcpu;
+ int *readers_influx;
+};
+
#endif /* !_SYS__RMLOCK_H_ */