summaryrefslogtreecommitdiff
path: root/src/audiocacheeventhandler.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2016-07-14 18:51:08 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-07-14 18:51:08 +0200
commit2247c698d8f7dc5725f4d491e798c5147273ca1e (patch)
treeafcf538eed28bcc414e57c6c7c840736a237bc24 /src/audiocacheeventhandler.cc
parentbe054acce347a227dc89308172543b64766ce0d2 (diff)
Move free-wheel control into the main run method.
Diffstat (limited to 'src/audiocacheeventhandler.cc')
-rw-r--r--src/audiocacheeventhandler.cc20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/audiocacheeventhandler.cc b/src/audiocacheeventhandler.cc
index a0261a5..a0327b5 100644
--- a/src/audiocacheeventhandler.cc
+++ b/src/audiocacheeventhandler.cc
@@ -96,26 +96,12 @@ void AudioCacheEventHandler::stop()
void AudioCacheEventHandler::setThreaded(bool threaded)
{
- if(this->threaded == threaded)
- {
- return;
- }
-
- if(threaded && !running)
- {
- start();
- }
- else if(!threaded && running)
- {
- stop();
- }
-
- this->threaded = threaded;
+ this->threaded.store(threaded);
}
bool AudioCacheEventHandler::isThreaded() const
{
- return threaded;
+ return threaded.load();
}
void AudioCacheEventHandler::lock()
@@ -279,7 +265,7 @@ void AudioCacheEventHandler::thread_main()
void AudioCacheEventHandler::pushEvent(CacheEvent& cache_event)
{
- if(!threaded)
+ if(!threaded.load())
{
handleEvent(cache_event);
return;