waveview: now that _quit is protected by a mutex, it doesn't need to be atomic
No reason to have two memory fences when we only need one
This commit is contained in:
@@ -255,8 +255,8 @@ WaveViewCache::set_image_cache_threshold (uint64_t sz)
|
||||
/*-------------------------------------------------*/
|
||||
|
||||
WaveViewThreads::WaveViewThreads ()
|
||||
: _quit (false)
|
||||
{
|
||||
g_atomic_int_set (&_quit, 0);
|
||||
}
|
||||
|
||||
WaveViewThreads::~WaveViewThreads ()
|
||||
@@ -359,7 +359,7 @@ WaveViewThreads::stop_threads ()
|
||||
|
||||
{
|
||||
Glib::Threads::Mutex::Lock lm (_queue_mutex);
|
||||
g_atomic_int_set (&_quit, 1);
|
||||
_quit = true;
|
||||
_cond.broadcast ();
|
||||
}
|
||||
|
||||
@@ -419,7 +419,8 @@ WaveViewThreads::_thread_proc ()
|
||||
|
||||
_queue_mutex.lock ();
|
||||
|
||||
if (g_atomic_int_get (&_quit)) {
|
||||
if (_quit) {
|
||||
/* time to die */
|
||||
_queue_mutex.unlock ();
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ private:
|
||||
// TODO use std::unique_ptr when possible
|
||||
typedef std::vector<boost::shared_ptr<WaveViewDrawingThread> > WaveViewThreadList;
|
||||
|
||||
GATOMIC_QUAL gint _quit;
|
||||
bool _quit;
|
||||
WaveViewThreadList _threads;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user