summaryrefslogtreecommitdiff
path: root/kern/mutex.h
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-01-30 20:44:24 +0100
committerRichard Braun <rbraun@sceen.net>2018-01-30 20:44:24 +0100
commit9967e907feda967f237c30430f47357bc91332f5 (patch)
treeafad99fa69ba8cd0aa38c7bc695667520805d4c5 /kern/mutex.h
parentbc6e853d4b27055056eebfd871aaf0fc60405b0f (diff)
Fix condition variable broadcasting
The broadcast implementation is based on an invalid assumption, namely that the first mutex_unlock call following condition_wait would be invoked on the same mutex. Fixing this while guarding against the thundering herd effect requires augmenting mutexes with a pointer to the condition variable they may be associated with. Since the size of mutexes is currently more important than broadcast scalability, the implementation is simplified into one which suffers from the thundering herd effect.
Diffstat (limited to 'kern/mutex.h')
-rw-r--r--kern/mutex.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/kern/mutex.h b/kern/mutex.h
index 10872e6e..b4332dea 100644
--- a/kern/mutex.h
+++ b/kern/mutex.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2017 Richard Braun.
+ * Copyright (c) 2013-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
@@ -37,7 +37,6 @@
#include <kern/init.h>
#include <kern/mutex_types.h>
-#include <kern/thread.h>
/*
* Initialize a mutex.
@@ -102,12 +101,6 @@ static inline void
mutex_unlock(struct mutex *mutex)
{
mutex_impl_unlock(mutex);
-
- /*
- * If this mutex was used along with a condition variable, wake up
- * a potential pending waiter.
- */
- thread_wakeup_last_cond();
}
/*