Skip to content

Commit

Permalink
Provide jack2 compatible implementation for jack1
Browse files Browse the repository at this point in the history
jack1 (which is Linux only) does not have a jack_client_stop_thread
API, and expects the application to call pthread_join().

This fixes an issue when the application is compiled using jack2 headers
but the application later runs using jack1's library.
  • Loading branch information
x42 committed Jun 30, 2022
1 parent 1f6abbb commit 13de664
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libs/backends/jack/weak_libjack.def
Expand Up @@ -138,7 +138,12 @@ JCFUN(0, int, client_real_time_priority, 0)
JCFUN(0, int, client_max_real_time_priority, 0)
JPFUN(0, int, acquire_real_time_scheduling, (jack_native_thread_t t, int p), (t,p), 0)
JPFUN(0, int, drop_real_time_scheduling, (jack_native_thread_t t), (t), 0)
#if (!defined _WIN32 && (defined _REENTRANT || defined __linux__))
/* on POSIX systems, call pthread_join() when libjack does not provide jack_client_stop_thread */
JXFUN(0, int, client_stop_thread, (jack_client_t* c, jack_native_thread_t t), (c,t), if (t) { pthread_join(t, NULL); return 0; } else { return -1;})
#else
JPFUN(0, int, client_stop_thread, (jack_client_t* c, jack_native_thread_t t), (c,t), 0)
#endif
JPFUN(0, int, client_kill_thread, (jack_client_t* c, jack_native_thread_t t), (c,t), 0)
#ifndef _WIN32
JVFUN(0, set_thread_creator, (jack_thread_creator_t c), (c),)
Expand Down

0 comments on commit 13de664

Please sign in to comment.