13
0

Provide jack2 compatible implementation for jack1

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.
This commit is contained in:
Robin Gareus 2022-06-30 17:19:57 +02:00
parent 1f6abbb756
commit 13de664ae6
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -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),)