diff options
author | David Robillard <d@drobilla.net> | 2016-07-31 16:25:42 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2016-07-31 16:25:42 -0400 |
commit | 398b7e32e003e17e9805e4c1dbfa12fc59373c17 (patch) | |
tree | cf21d5e44d54710e3deadabcfc7ff1d336aac87c /src/worker.c | |
parent | f4ee02db64ee39f1653cbc5373abaa748707e580 (diff) | |
download | jalv-398b7e32e003e17e9805e4c1dbfa12fc59373c17.tar.gz jalv-398b7e32e003e17e9805e4c1dbfa12fc59373c17.tar.bz2 jalv-398b7e32e003e17e9805e4c1dbfa12fc59373c17.zip |
Do not call plugin work() method concurrently
Diffstat (limited to 'src/worker.c')
-rw-r--r-- | src/worker.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/worker.c b/src/worker.c index 79b220c..9035733 100644 --- a/src/worker.c +++ b/src/worker.c @@ -50,8 +50,10 @@ worker_func(void* data) jack_ringbuffer_read(worker->requests, (char*)buf, size); + zix_sem_wait(&jalv->work_lock); worker->iface->work( jalv->instance->lv2_handle, jalv_worker_respond, worker, size, buf); + zix_sem_post(&jalv->work_lock); } free(buf); @@ -105,8 +107,10 @@ jalv_worker_schedule(LV2_Worker_Schedule_Handle handle, zix_sem_post(&worker->sem); } else { // Execute work immediately in this thread + zix_sem_wait(&jalv->work_lock); worker->iface->work( jalv->instance->lv2_handle, jalv_worker_respond, worker, size, data); + zix_sem_post(&jalv->work_lock); } return LV2_WORKER_SUCCESS; } |