From 50157a8d1773aba37e3949f16472082a405ef8cf Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 7 Feb 2022 14:22:39 -0500 Subject: [PATCH] kernel/condition_variable: Make ConditionVariableEntry::Variable non-inline. We have to use an atomic here. --- headers/private/kernel/condition_variable.h | 2 +- src/system/kernel/condition_variable.cpp | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/headers/private/kernel/condition_variable.h b/headers/private/kernel/condition_variable.h index 0565eb5d53..c05b1e2242 100644 --- a/headers/private/kernel/condition_variable.h +++ b/headers/private/kernel/condition_variable.h @@ -33,7 +33,7 @@ public: status_t Wait(const void* object, uint32 flags = 0, bigtime_t timeout = 0); - inline ConditionVariable* Variable() const { return fVariable; } + ConditionVariable* Variable() const; private: inline void _AddToLockedVariable(ConditionVariable* variable); diff --git a/src/system/kernel/condition_variable.cpp b/src/system/kernel/condition_variable.cpp index 04f4de6cb3..5f06535b7c 100644 --- a/src/system/kernel/condition_variable.cpp +++ b/src/system/kernel/condition_variable.cpp @@ -129,6 +129,13 @@ ConditionVariableEntry::Add(const void* object) } +ConditionVariable* +ConditionVariableEntry::Variable() const +{ + return atomic_pointer_get(&fVariable); +} + + inline void ConditionVariableEntry::_AddToLockedVariable(ConditionVariable* variable) {