VLC
4.0.0-dev
|
![]() |
Typedefs | |
typedef pthread_key_t | vlc_threadvar_t |
Thread-local key handle. More... | |
Functions | |
int | vlc_threadvar_create (vlc_threadvar_t *key, void(*destr)(void *)) |
Allocates a thread-specific variable. More... | |
void | vlc_threadvar_delete (vlc_threadvar_t *) |
Deallocates a thread-specific variable. More... | |
int | vlc_threadvar_set (vlc_threadvar_t key, void *value) |
Sets a thread-specific variable. More... | |
void * | vlc_threadvar_get (vlc_threadvar_t) |
Gets the value of a thread-local variable for the calling thread. More... | |
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::destroy, vlc_threadvar::id, vlc_threadvar::next, vlc_threadvar::prev, super_mutex, unlikely, var, vlc_mutex_lock(), vlc_mutex_unlock(), and vlc_threadvar_last.
Referenced by _DLL_InitTerm().
void vlc_threadvar_delete | ( | vlc_threadvar_t * | ) |
Deallocates a thread-specific variable.
References vlc_threadvar::id, vlc_threadvar::next, vlc_threadvar::prev, super_mutex, var, vlc_mutex_lock(), vlc_mutex_unlock(), and vlc_threadvar_last.
Referenced by _DLL_InitTerm().
void* vlc_threadvar_get | ( | vlc_threadvar_t | ) |
Gets the value of a thread-local variable for the calling thread.
This function cannot fail.
Referenced by vlc_control_cancel(), vlc_DosWaitEventSemEx(), vlc_restorecancel(), vlc_savecancel(), vlc_select(), vlc_testcancel(), vlc_thread_cleanup(), and vlc_threadvars_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_entry(), vlc_thread_cleanup(), and vlc_threadvars_cleanup().