globus_thread.h(3)
πΈ NAME πΈ
globus_thread.h β the Globus Threading Abstraction. This is the header you grab when you want threads to just work, no matter what runtime config you're living in. Welcome to the Library Functions Manual, bestie, we're doing concurrency today π
π¦ SYNOPSIS π¦
#include 'globus_module.h'
#include 'globus_time.h'
#include <unistd.h>
π Data Structures π
union globus_thread_tβ Thread ID. Like, your thread's whole identity β¨union globus_threadattr_tβ Thread attributes.union globus_mutex_tβ Mutex. The vibe-lock πunion globus_cond_tβ Condition variable.union globus_mutexattr_tβ Mutex attribute.union globus_condattr_tβ Condition variable attribute.union globus_thread_key_tβ Thread-specific data key.union globus_thread_once_tβ Thread once structure.
π§ Macros π§
#define GLOBUS_THREAD_ONCE_INITβ Thread once initializer value.#define GLOBUS_THREAD_CANCEL_DISABLE 0β Disable thread cancellation value.#define GLOBUS_THREAD_CANCEL_ENABLE 1β Enable thread cancellation value.#define GLOBUS_THREAD_MODULEβ Thread Module.
π¦ Typedefs π¦
typedef void(* globus_thread_key_destructor_func_t) (void *value)β Thread-specific data destructor.
π Functions π
int globus_thread_set_model (const char *model)β Select threading model for an application.int globus_mutex_init (globus_mutex_t *mutex, globus_mutexattr_t *attr)β Initialize a mutex.int globus_mutex_destroy (globus_mutex_t *mutex)β Destroy a mutex.int globus_mutex_lock (globus_mutex_t *mutex)β Lock a mutex.int globus_mutex_unlock (globus_mutex_t *mutex)β Unlock a mutex.int globus_mutex_trylock (globus_mutex_t *mutex)β Lock a mutex if it is not locked.int globus_cond_init (globus_cond_t *cond, globus_condattr_t *attr)β Initialize a condition variable
The globus_cond_init() function creates a condition variable that can be used for event signalling between threads.
int globus_cond_destroy (globus_cond_t *cond)β Destroy a condition variable.int globus_cond_wait (globus_cond_t *cond, globus_mutex_t *mutex)β Wait for a condition to be signalled.int globus_cond_timedwait (globus_cond_t *cond, globus_mutex_t *mutex, globus_abstime_t *abstime)β Wait for a condition to be signalled.int globus_cond_signal (globus_cond_t *cond)β Signal a condition to a thread.int globus_cond_broadcast (globus_cond_t *cond)β Signal a condition to multiple threads.int globus_condattr_init (globus_condattr_t *cond_attr)β Initialize a condition variable attribute.int globus_condattr_destroy (globus_condattr_t *cond_attr)β Destroy a condition attribute.int globus_condattr_setspace (globus_condattr_t *cond_attr, int space)β Set callback space associated with a condition variable attribute
The globus_condattr_setspace() function sets the callback space to use with condition variables created with this attribute. Callback spaces are used to control how callbacks are issued to different threads. See Callback Spaces for more information on callback spaces.
int globus_condattr_getspace (globus_condattr_t *cond_attr, int *space)β Get callback space associated with a condition variable attribute
The globus_condattr_getspace() function copies the value of the callback space associated with a condition variable attribute to the integer pointed to by the space parameter.
int globus_thread_create (globus_thread_t *thread, globus_threadattr_t *attr, globus_thread_func_t func, void *user_arg)β Create a new thread.void * globus_thread_getspecific (globus_thread_key_t key)β Get a thread-specific data value.int globus_thread_setspecific (globus_thread_key_t key, void *value)β Set a thread-specific data value.int globus_thread_key_create (globus_thread_key_t *key, globus_thread_key_destructor_func_t func)β Create a key for thread-specific storage.int globus_thread_key_delete (globus_thread_key_t key)β Delete a thread-local storage key.int globus_thread_once (globus_thread_once_t *once, void(*init_routine)(void))β Execute a function one time.void globus_thread_yield (void)β Yield execution to another thread.int globus_thread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask)β Modify the current thread's signal mask.int globus_thread_kill (globus_thread_t thread, int sig)β Send a signal to a thread.void globus_thread_exit (void *value)β Terminate the current thread.globus_thread_t globus_thread_self (void)β Determine the current thread's ID.int globus_thread_equal (globus_thread_t thread1, globus_thread_t thread2)β Check whether thread identifiers match.globus_bool_t globus_i_am_only_thread (void)β Determine if threads are supported.globus_bool_t globus_thread_preemptive_threads (void)β Indicate whether the active thread model supports preemption.void * globus_thread_cancellable_func (void *(*func)(void *), void *arg, void(*cleanup_func)(void *), void *cleanup_arg, globus_bool_t execute_cleanup)β Execute a function with thread cleanup in case of cancellation.int globus_thread_cancel (globus_thread_t thr)β Cancel a thread.void globus_thread_testcancel (void)β Thread cancellation point.int globus_thread_setcancelstate (int state, int *oldstate)β Set the thread's cancellable state.
β¨ Detailed Description β¨
Globus Threading Abstraction.
Globus threads package which can work with either pthreads or without threads, depending on runtime configuration. No cap, it really does switch it up based on your runtime setup π«Ά
π Author π
Generated automatically by Doxygen for globus_common from the source code.
Okay that's the whole page, bestie!! π Shoutout to globus_common, Version 18.15, and the whole globus_thread.h(3) manual-page moment β iconic, legendary, ate, periodt. Go forth and thread safely β¨π
π¦
π¦ where this page comes from
- epel 10: globus-common-doc 18.15-1.el10_2 Β· Apache-2.0
- fedora 43: globus-common-doc 18.15-1.fc43 Β· Apache-2.0
- fedora 44: globus-common-doc 18.15-2.fc44 Β· Apache-2.0
- ubuntu resolute: libglobus-common-doc 18.15-1 Β· Apache-2.0
- ubuntu stonking: libglobus-common-doc 18.15-2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms