fix LV2 worker

start worker thread after _sem and _exit have been initialized.
stop thread when plugin is removed.

git-svn-id: svn://localhost/ardour2/branches/3.0@13145 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Robin Gareus
2012-08-27 04:08:48 +00:00
parent 0a834da466
commit a8f0c3255f
3 changed files with 3 additions and 2 deletions

View File

@@ -77,12 +77,12 @@ private:
void run();
Workee* _workee;
Glib::Threads::Thread* _thread;
RingBuffer<uint8_t>* _requests;
RingBuffer<uint8_t>* _responses;
uint8_t* _response;
PBD::Semaphore _sem;
bool _exit;
Glib::Threads::Thread* _thread;
};
} // namespace ARDOUR

View File

@@ -560,6 +560,7 @@ LV2Plugin::~LV2Plugin ()
delete _to_ui;
delete _from_ui;
delete _worker;
delete [] _control_data;
delete [] _shadow_data;

View File

@@ -26,12 +26,12 @@ namespace ARDOUR {
Worker::Worker(Workee* workee, uint32_t ring_size)
: _workee(workee)
, _thread (Glib::Threads::Thread::create(sigc::mem_fun(*this, &Worker::run)))
, _requests(new RingBuffer<uint8_t>(ring_size))
, _responses(new RingBuffer<uint8_t>(ring_size))
, _response((uint8_t*)malloc(ring_size))
, _sem(0)
, _exit(false)
, _thread (Glib::Threads::Thread::create(sigc::mem_fun(*this, &Worker::run)))
{}
Worker::~Worker()