From 9967e907feda967f237c30430f47357bc91332f5 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Tue, 30 Jan 2018 20:44:24 +0100 Subject: 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. --- kern/thread.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'kern/thread.c') diff --git a/kern/thread.c b/kern/thread.c index 330b5375..f41e5936 100644 --- a/kern/thread.c +++ b/kern/thread.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2017 Richard Braun. + * Copyright (c) 2012-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 @@ -92,7 +92,6 @@ #include #include -#include #include #include #include @@ -1821,7 +1820,6 @@ thread_init(struct thread *thread, void *stack, } turnstile_td_init(&thread->turnstile_td); - thread->last_cond = NULL; thread->propagate_priority = false; thread->preempt_level = THREAD_SUSPEND_PREEMPT_LEVEL; thread->pin_level = 0; -- cgit v1.2.3