VLC 4.0.0-dev
|
Typedefs | |
typedef pthread_key_t | vlc_threadvar_t |
Thread-local key handle. | |
Functions | |
int | vlc_threadvar_create (vlc_threadvar_t *key, void(*destr)(void *)) |
Allocates a thread-specific variable. | |
void | vlc_threadvar_delete (vlc_threadvar_t *) |
Deallocates a thread-specific variable. | |
int | vlc_threadvar_set (vlc_threadvar_t key, void *value) |
Sets a thread-specific variable. | |
void * | vlc_threadvar_get (vlc_threadvar_t) |
Gets the value of a thread-local variable for the calling thread. | |
typedef pthread_key_t vlc_threadvar_t |
Thread-local key handle.
int vlc_threadvar_create | ( | vlc_threadvar_t * | key, |
void(*)(void *) | destr | ||
) |
Allocates a thread-specific variable.
key | where to store the thread-specific variable handle |
destr | a destruction callback. It is called whenever a thread exits and the thread-specific variable has a non-NULL value. |
References vlc_threadvar::next, vlc_threadvar::prev, super_lock, super_mutex, unlikely, var, vlc_mutex_lock(), vlc_mutex_unlock(), and vlc_threadvar_last.
void vlc_threadvar_delete | ( | vlc_threadvar_t * | p_tls | ) |
Deallocates a thread-specific variable.
References vlc_threadvar::prev, super_lock, super_mutex, var, vlc_mutex_lock(), vlc_mutex_unlock(), and vlc_threadvar_last.
void * vlc_threadvar_get | ( | vlc_threadvar_t | key | ) |
Gets the value of a thread-local variable for the calling thread.
This function cannot fail.
Referenced by vlc_thread_cleanup().
int vlc_threadvar_set | ( | vlc_threadvar_t | key, |
void * | value | ||
) |
Sets a thread-specific variable.
key | thread-local variable key (created with vlc_threadvar_create()) |
value | new value for the variable for the calling thread |
Referenced by vlc_thread_cleanup().