aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION2
-rw-r--r--bin/synthpod_sandbox_x11.c17
-rw-r--r--sandbox_ui.lv2/sandbox_io.h3
3 files changed, 13 insertions, 9 deletions
diff --git a/VERSION b/VERSION
index 22e4fb4..5abb640 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.5829
+0.1.5831
diff --git a/bin/synthpod_sandbox_x11.c b/bin/synthpod_sandbox_x11.c
index fef0a7e..bc3be8b 100644
--- a/bin/synthpod_sandbox_x11.c
+++ b/bin/synthpod_sandbox_x11.c
@@ -192,16 +192,21 @@ _run(sandbox_slave_t *sb, float update_rate, void *data)
if(sandbox_slave_timedwait(sb, &to)) // timedout
{
-#if 0
struct timespec tf;
+
cross_clock_gettime(&app->clk_real, &tf);
- const double d0 = to.tv_sec + 1e-9*to.tv_nsec;
- const double d1 = tf.tv_sec + 1e-9*tf.tv_nsec;
- printf("%i, %lf, %f\n", getpid(), d0, d1);
+ const uint64_t dd = (tf.tv_sec - to.tv_sec) * 1000000000
+ + (tf.tv_nsec - to.tv_nsec);
+
+#if 0
+ printf(":: %i, %lums\n", getpid(), dd/1000000);
#endif
- if(app->idle_iface->idle(app->handle))
- atomic_store_explicit(&done, true, memory_order_relaxed);
+ if(dd <= ns)
+ {
+ if(app->idle_iface->idle(app->handle))
+ atomic_store_explicit(&done, true, memory_order_relaxed);
+ }
to.tv_nsec += ns;
while(to.tv_nsec >= 1000000000)
diff --git a/sandbox_ui.lv2/sandbox_io.h b/sandbox_ui.lv2/sandbox_io.h
index 4f6940e..7b89c1f 100644
--- a/sandbox_ui.lv2/sandbox_io.h
+++ b/sandbox_ui.lv2/sandbox_io.h
@@ -383,8 +383,7 @@ _sandbox_io_timedwait(sandbox_io_t *io, const struct timespec *abs_timeout)
? io->to_master
: io->from_master;
- int s;
- while((s = sem_timedwait(&rx->sem, abs_timeout)) == -1)
+ while(sem_timedwait(&rx->sem, abs_timeout) == -1)
{
switch(errno)
{