consolidate semaphore implementation (part two)

This commit is contained in:
Robin Gareus 2015-12-02 16:08:53 +01:00
parent 003b632ed1
commit f5278f60d3
2 changed files with 6 additions and 4 deletions

View File

@ -52,7 +52,9 @@ AudioRegionEditor::AudioRegionEditor (Session* s, boost::shared_ptr<AudioRegion>
: RegionEditor (s, r)
, _audio_region (r)
, gain_adjustment(accurate_coefficient_to_dB(_audio_region->scale_amplitude()), -40.0, +40.0, 0.1, 1.0, 0)
#ifndef PLATFORM_WINDOWS
#ifdef PLATFORM_WINDOWS
, m_peak_sem ("peak_semaphore", 0)
#else
, _peak_channel (false)
#endif
{
@ -137,7 +139,7 @@ void
AudioRegionEditor::signal_peak_thread ()
{
#ifdef PLATFORM_WINDOWS
m_peak_sem.post ();
m_peak_sem.signal ();
#else
_peak_channel.deliver ('c');
#endif

View File

@ -37,7 +37,7 @@
#include "pbd/signals.h"
#ifdef PLATFORM_WINDOWS
#include "pbd/glib_semaphore.h"
#include "pbd/semutils.h"
#else
#include "pbd/crossthread.h"
#endif
@ -84,7 +84,7 @@ class AudioRegionEditor : public RegionEditor
PBD::Signal1<void, double> PeakAmplitudeFound;
PBD::ScopedConnection _peak_amplitude_connection;
#ifdef PLATFORM_WINDOWS
PBD::GlibSemaphore m_peak_sem;
PBD::ProcessSemaphore m_peak_sem;
#else
CrossThreadChannel _peak_channel;
#endif