diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-19 09:18:57 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-10-19 09:18:57 +0200 |
commit | 515a3f8e3a3e6091cc58798c36fe51859178143b (patch) | |
tree | 0822a74f4f3a4b65774547211335f114cf3018ca /options/value.hpp | |
parent | efb9167c2eb8b609a8bc86c119b6a77e999681bf (diff) |
Revert "options/tie: fix deadlocks"
This reverts commit 2ef545b487209fb03bc2506b8e9bfa345d0f392b.
Diffstat (limited to 'options/value.hpp')
-rw-r--r-- | options/value.hpp | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/options/value.hpp b/options/value.hpp index 849611d3..10903b19 100644 --- a/options/value.hpp +++ b/options/value.hpp @@ -39,9 +39,7 @@ template<typename t> class value final : public value_ { static_assert(std::is_same_v<t, remove_cvref_t<t>>); - mutable QMutex mtx; const t def; - mutable t cached_value = def; using traits = detail::value_traits<t>; never_inline @@ -97,24 +95,10 @@ public: never_inline void notify() const override { - if (is_null()) - return; - - auto x = get(); - - bool b = progn( - QMutexLocker l(&mtx); - if (!traits::is_equal(x, cached_value)) - { - cached_value = x; - return true; - } - return false; - ); - - if (b) { + if (!is_null()) + { maybe_trace(true); - emit valueChanged(traits::storage_from_value(x)); + emit valueChanged(traits::storage_from_value(get())); maybe_trace(false); } } |