Crudebyte Logo
JACKiOS  1.9.10.3
Creating and managing client threads

Detailed Description

Refer to the description of thread.h fore a more detailed explanation about this API part.

See Also
The non-callback API

Typedefs

typedef int(* jack_thread_creator_t )(pthread_t *, const pthread_attr_t *, void *(*function)(void *), void *arg)

Functions

int jack_client_real_time_priority (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT
int jack_client_max_real_time_priority (jack_client_t *) JACK_OPTIONAL_WEAK_EXPORT
int jack_acquire_real_time_scheduling (jack_native_thread_t thread, int priority) JACK_OPTIONAL_WEAK_EXPORT
int jack_client_create_thread (jack_client_t *client, jack_native_thread_t *thread, int priority, int realtime, void *(*start_routine)(void *), void *arg) JACK_OPTIONAL_WEAK_EXPORT
int jack_drop_real_time_scheduling (jack_native_thread_t thread) JACK_OPTIONAL_WEAK_EXPORT
int jack_client_stop_thread (jack_client_t *client, jack_native_thread_t thread) JACK_OPTIONAL_WEAK_EXPORT
int jack_client_kill_thread (jack_client_t *client, jack_native_thread_t thread) JACK_OPTIONAL_WEAK_EXPORT
void jack_set_thread_creator (jack_thread_creator_t creator) JACK_OPTIONAL_WEAK_EXPORT

Function Documentation

int jack_client_real_time_priority ( jack_client_t )
Returns
if JACK is running with realtime scheduling, this returns the priority that any JACK-created client threads will run at. Otherwise returns -1.
int jack_client_max_real_time_priority ( jack_client_t )
Returns
if JACK is running with realtime scheduling, this returns the maximum priority that a JACK client thread should use if the thread is subject to realtime scheduling. Otherwise returns -1.
int jack_acquire_real_time_scheduling ( jack_native_thread_t  thread,
int  priority 
)

Attempt to enable realtime scheduling for a thread. On some systems that may require special privileges.

Parameters
threadPOSIX thread ID.
priorityrequested thread priority.
Returns
0, if successful; EPERM, if the calling process lacks required realtime privileges; otherwise some other error number.
int jack_client_create_thread ( jack_client_t client,
jack_native_thread_t *  thread,
int  priority,
int  realtime,
void *(*)(void *)  start_routine,
void *  arg 
)

Create a thread for JACK or one of its clients. The thread is created executing start_routine with arg as its sole argument.

Parameters
clientthe JACK client for whom the thread is being created. May be NULL if the client is being created within the JACK server.
threadplace to return POSIX thread ID.
prioritythread priority, if realtime.
realtimetrue for the thread to use realtime scheduling. On some systems that may require special privileges.
start_routinefunction the thread calls when it starts.
argparameter passed to the start_routine.
Returns
0, if successful; otherwise some error number.
int jack_drop_real_time_scheduling ( jack_native_thread_t  thread)

Drop realtime scheduling for a thread.

Parameters
threadPOSIX thread ID.
Returns
0, if successful; otherwise an error number.
int jack_client_stop_thread ( jack_client_t client,
jack_native_thread_t  thread 
)

Stop the thread, waiting for the thread handler to terminate.

Parameters
threadPOSIX thread ID.
Returns
0, if successful; otherwise an error number.
int jack_client_kill_thread ( jack_client_t client,
jack_native_thread_t  thread 
)

Kill the thread.

Parameters
threadPOSIX thread ID.
Returns
0, if successful; otherwise an error number.
void jack_set_thread_creator ( jack_thread_creator_t  creator)

This function can be used in very very specialized cases where it is necessary that client threads created by JACK are created by something other than pthread_create(). After it is used, any threads that JACK needs for the client will will be created by calling the function passed to this function.

No normal application/client should consider calling this. The specific case for which it was created involves running win32/x86 plugins under Wine on Linux, where it is necessary that all threads that might call win32 functions are known to Wine.

Set it to NULL to restore thread creation function.

Parameters
creatora function that creates a new thread
DE • EN
Copyright © MMXIII Crudebyte. All rights reserved.

twitter