Skip to content
Permalink
Browse files

Fix TimeFX threading (detached thread must not be joined)

  • Loading branch information...
x42 committed Feb 26, 2019
1 parent 5f1e2d4 commit 1776939dd357ac5d804810b8e2264c852f949d41
Showing with 2 additions and 9 deletions.
  1. +2 −9 gtk2_ardour/editor_timefx.cc
@@ -301,15 +301,14 @@ Editor::time_fx (RegionList& regions, float val, bool pitching)
current_timefx->first_delete = current_timefx->signal_delete_event().connect
(sigc::mem_fun (current_timefx, &TimeFXDialog::delete_in_progress));

current_timefx->start_updates ();

if (pthread_create_and_store ("timefx", &current_timefx->request.thread, timefx_thread, current_timefx)) {
current_timefx->hide ();
error << _("timefx cannot be started - thread creation error") << endmsg;
return -1;
}

pthread_detach (current_timefx->request.thread);
current_timefx->start_updates ();

while (!current_timefx->request.done && !current_timefx->request.cancel) {
gtk_main_iteration ();
@@ -408,12 +407,6 @@ Editor::timefx_thread (void *arg)
event loop doesn't die before any changes we made are processed
by the GUI ...
*/

#ifdef PLATFORM_WINDOWS
Glib::usleep(2 * G_USEC_PER_SEC);
#else
struct timespec t = { 2, 0 };
nanosleep (&t, 0);
#endif
Glib::usleep(G_USEC_PER_SEC / 5);
return 0;
}

0 comments on commit 1776939

Please sign in to comment.
You can’t perform that action at this time.