summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_thread.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2012-05-30 16:06:38 +0000
committerkib <kib@FreeBSD.org>2012-05-30 16:06:38 +0000
commit6f4e16f8338923e9fd89009ec9cb4a5a3d770983 (patch)
tree4caf91c8f8e723003a46c63db3286a9280250541 /sys/kern/kern_thread.c
parentb4b050eda28e90a7c843fa7fa999ce50dd3c3872 (diff)
downloadFreeBSD-src-6f4e16f8338923e9fd89009ec9cb4a5a3d770983.zip
FreeBSD-src-6f4e16f8338923e9fd89009ec9cb4a5a3d770983.tar.gz
Add a rangelock implementation, intended to be used to range-locking
the i/o regions of the vnode data space. The implementation is quite simple-minded, it uses the list of the lock requests, ordered by arrival time. Each request may be for read or for write. The implementation is fair FIFO. MFC after: 2 month
Diffstat (limited to 'sys/kern/kern_thread.c')
-rw-r--r--sys/kern/kern_thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index 3fbe96f..69a416e 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/rangelock.h>
#include <sys/resourcevar.h>
#include <sys/sdt.h>
#include <sys/smp.h>
@@ -205,6 +206,7 @@ thread_init(void *mem, int size, int flags)
td->td_sleepqueue = sleepq_alloc();
td->td_turnstile = turnstile_alloc();
+ td->td_rlqe = NULL;
EVENTHANDLER_INVOKE(thread_init, td);
td->td_sched = (struct td_sched *)&td[1];
umtx_thread_init(td);
@@ -222,6 +224,7 @@ thread_fini(void *mem, int size)
td = (struct thread *)mem;
EVENTHANDLER_INVOKE(thread_fini, td);
+ rlqentry_free(td->td_rlqe);
turnstile_free(td->td_turnstile);
sleepq_free(td->td_sleepqueue);
umtx_thread_fini(td);
OpenPOWER on IntegriCloud