aboutsummaryrefslogtreecommitdiffstats
path: root/src/GlobalEvents.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-02-27 20:35:44 +0100
committerMax Kellermann <max@duempel.org>2013-02-27 20:35:44 +0100
commit19c67ab72457d68fa35bdad8b4c5ed5ecf04816e (patch)
treea1a7a72c1e25ffc586d48777e88a63f06835a714 /src/GlobalEvents.cxx
parenta046b6e10538ec8d31d63701b8fa6309bf26fe16 (diff)
downloadmpd-19c67ab72457d68fa35bdad8b4c5ed5ecf04816e.tar.gz
mpd-19c67ab72457d68fa35bdad8b4c5ed5ecf04816e.tar.xz
mpd-19c67ab72457d68fa35bdad8b4c5ed5ecf04816e.zip
Idle, GlobalEvents: use std::atomic::exchange()
Less overhead than fetch_and() for what we do.
Diffstat (limited to '')
-rw-r--r--src/GlobalEvents.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/GlobalEvents.cxx b/src/GlobalEvents.cxx
index e4f335c9e..7c4ffdc16 100644
--- a/src/GlobalEvents.cxx
+++ b/src/GlobalEvents.cxx
@@ -59,7 +59,7 @@ GlobalEventCallback(G_GNUC_UNUSED GIOChannel *source,
if (!GlobalEvents::wake_fd.Read())
return true;
- const unsigned flags = GlobalEvents::flags.fetch_and(0);
+ const unsigned flags = GlobalEvents::flags.exchange(0);
for (unsigned i = 0; i < GlobalEvents::MAX; ++i)
if (flags & (1u << i))