jack: client_thread_id should return the data thread

Add a function in data-loop to get the natvive thread and use that
in client_thread_id() so that it returns the pthread of the
data thread instead of the caller thread.
This commit is contained in:
Wim Taymans 2021-07-02 11:39:44 +02:00
parent 4b9b97841d
commit e2d6545e77
3 changed files with 24 additions and 1 deletions

View file

@ -3239,7 +3239,15 @@ int jack_get_client_pid (const char *name)
SPA_EXPORT
jack_native_thread_t jack_client_thread_id (jack_client_t *client)
{
return pthread_self();
struct client *c = (struct client *) client;
void *thr;
spa_return_val_if_fail(c != NULL, -EINVAL);
thr = pw_data_loop_get_thread(c->loop);
if (thr == NULL)
return pthread_self();
return *(pthread_t*)thr;
}
SPA_EXPORT