aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Idle.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Idle.cxx b/src/Idle.cxx
index f1423ebeb..fefbd2fe9 100644
--- a/src/Idle.cxx
+++ b/src/Idle.cxx
@@ -52,9 +52,10 @@ idle_add(unsigned flags)
{
assert(flags != 0);
- idle_flags |= flags;
+ unsigned old_flags = idle_flags.fetch_or(flags);
- GlobalEvents::Emit(GlobalEvents::IDLE);
+ if ((old_flags & flags) != flags)
+ GlobalEvents::Emit(GlobalEvents::IDLE);
}
unsigned