RemoteVstPlugin: encapsulate locking in separate inline functions

Locking the plugin is now achieved by calling RemoteVstPlugin::lock()
and RemoteVstPlugin::unlock().

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
(cherry picked from commit 2240d6644d)
This commit is contained in:
Tobias Doerffel
2009-07-09 12:31:59 +02:00
parent 91912e143a
commit 9fc0d8962d

View File

@@ -204,6 +204,16 @@ public:
// has to be called as soon as input- or output-count changes
void updateInOutCount();
inline void lock()
{
pthread_mutex_lock( &m_pluginLock );
}
inline void unlock()
{
pthread_mutex_unlock( &m_pluginLock );
}
static DWORD WINAPI processingThread( LPVOID _param );
static DWORD WINAPI guiEventLoop( LPVOID _param );
@@ -230,13 +240,13 @@ private:
void * p = NULL, float f = 0 )
{
int ret = 0;
pthread_mutex_lock( &m_pluginLock );
lock();
if( m_plugin )
{
ret = m_plugin->dispatcher( m_plugin, cmd, param1,
param2, p, f );
}
pthread_mutex_unlock( &m_pluginLock );
unlock();
return ret;
}