aboutsummaryrefslogtreecommitdiffstats
path: root/src/worker.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-07-31 16:25:42 -0400
committerDavid Robillard <d@drobilla.net>2016-07-31 16:25:42 -0400
commit398b7e32e003e17e9805e4c1dbfa12fc59373c17 (patch)
treecf21d5e44d54710e3deadabcfc7ff1d336aac87c /src/worker.c
parentf4ee02db64ee39f1653cbc5373abaa748707e580 (diff)
downloadjalv-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.c4
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;
}