.TH "globus_thread.h" 3 "Version 18.14" "globus_common" \" -*- nroff -*- .ad l .nh .SH NAME globus_thread.h \- Globus Threading Abstraction\&. .SH SYNOPSIS .br .PP \fC#include 'globus_module\&.h'\fP .br \fC#include 'globus_time\&.h'\fP .br \fC#include \fP .br .SS "Data Structures" .in +1c .ti -1c .RI "union \fBglobus_thread_t\fP" .br .RI "Thread ID\&. " .ti -1c .RI "union \fBglobus_threadattr_t\fP" .br .RI "Thread attributes\&. " .ti -1c .RI "union \fBglobus_mutex_t\fP" .br .RI "Mutex\&. " .ti -1c .RI "union \fBglobus_cond_t\fP" .br .RI "Condition variable\&. " .ti -1c .RI "union \fBglobus_mutexattr_t\fP" .br .RI "Mutex attribute\&. " .ti -1c .RI "union \fBglobus_condattr_t\fP" .br .RI "Condition variable attribute\&. " .ti -1c .RI "union \fBglobus_thread_key_t\fP" .br .RI "Thread-specific data key\&. " .ti -1c .RI "union \fBglobus_thread_once_t\fP" .br .RI "Thread once structure\&. " .in -1c .SS "Macros" .in +1c .ti -1c .RI "#define \fBGLOBUS_THREAD_ONCE_INIT\fP" .br .RI "Thread once initializer value\&. " .ti -1c .RI "#define \fBGLOBUS_THREAD_CANCEL_DISABLE\fP 0" .br .RI "Disable thread cancellation value\&. " .ti -1c .RI "#define \fBGLOBUS_THREAD_CANCEL_ENABLE\fP 1" .br .RI "Enable thread cancellation value\&. " .ti -1c .RI "#define \fBGLOBUS_THREAD_MODULE\fP" .br .RI "Thread Module\&. " .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef void(* \fBglobus_thread_key_destructor_func_t\fP) (void *value)" .br .RI "Thread-specific data destructor\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "int \fBglobus_thread_set_model\fP (const char *model)" .br .RI "Select threading model for an application\&. " .ti -1c .RI "int \fBglobus_mutex_init\fP (\fBglobus_mutex_t\fP *mutex, \fBglobus_mutexattr_t\fP *attr)" .br .RI "Initialize a mutex\&. " .ti -1c .RI "int \fBglobus_mutex_destroy\fP (\fBglobus_mutex_t\fP *mutex)" .br .RI "Destroy a mutex\&. " .ti -1c .RI "int \fBglobus_mutex_lock\fP (\fBglobus_mutex_t\fP *mutex)" .br .RI "Lock a mutex\&. " .ti -1c .RI "int \fBglobus_mutex_unlock\fP (\fBglobus_mutex_t\fP *mutex)" .br .RI "Unlock a mutex\&. " .ti -1c .RI "int \fBglobus_mutex_trylock\fP (\fBglobus_mutex_t\fP *mutex)" .br .RI "Lock a mutex if it is not locked\&. " .ti -1c .RI "int \fBglobus_cond_init\fP (\fBglobus_cond_t\fP *cond, \fBglobus_condattr_t\fP *attr)" .br .RI "Initialize a condition variable .PP The \fBglobus_cond_init()\fP function creates a condition variable that can be used for event signalling between threads\&. " .ti -1c .RI "int \fBglobus_cond_destroy\fP (\fBglobus_cond_t\fP *cond)" .br .RI "Destroy a condition variable\&. " .ti -1c .RI "int \fBglobus_cond_wait\fP (\fBglobus_cond_t\fP *cond, \fBglobus_mutex_t\fP *mutex)" .br .RI "Wait for a condition to be signalled\&. " .ti -1c .RI "int \fBglobus_cond_timedwait\fP (\fBglobus_cond_t\fP *cond, \fBglobus_mutex_t\fP *mutex, globus_abstime_t *abstime)" .br .RI "Wait for a condition to be signalled\&. " .ti -1c .RI "int \fBglobus_cond_signal\fP (\fBglobus_cond_t\fP *cond)" .br .RI "Signal a condition to a thread\&. " .ti -1c .RI "int \fBglobus_cond_broadcast\fP (\fBglobus_cond_t\fP *cond)" .br .RI "Signal a condition to multiple threads\&. " .ti -1c .RI "int \fBglobus_condattr_init\fP (\fBglobus_condattr_t\fP *cond_attr)" .br .RI "Initialize a condition variable attribute\&. " .ti -1c .RI "int \fBglobus_condattr_destroy\fP (\fBglobus_condattr_t\fP *cond_attr)" .br .RI "Destroy a condition attribute\&. " .ti -1c .RI "int \fBglobus_condattr_setspace\fP (\fBglobus_condattr_t\fP *cond_attr, int space)" .br .RI "Set callback space associated with a condition variable attribute .PP The \fBglobus_condattr_setspace()\fP 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 \fBCallback Spaces \fP for more information on callback spaces\&. " .ti -1c .RI "int \fBglobus_condattr_getspace\fP (\fBglobus_condattr_t\fP *cond_attr, int *space)" .br .RI "Get callback space associated with a condition variable attribute .PP The \fBglobus_condattr_getspace()\fP function copies the value of the callback space associated with a condition variable attribute to the integer pointed to by the \fIspace\fP parameter\&. " .ti -1c .RI "int \fBglobus_thread_create\fP (\fBglobus_thread_t\fP *thread, \fBglobus_threadattr_t\fP *attr, globus_thread_func_t func, void *user_arg)" .br .RI "Create a new thread\&. " .ti -1c .RI "void * \fBglobus_thread_getspecific\fP (\fBglobus_thread_key_t\fP key)" .br .RI "Get a thread-specific data value\&. " .ti -1c .RI "int \fBglobus_thread_setspecific\fP (\fBglobus_thread_key_t\fP key, void *value)" .br .RI "Set a thread-specific data value\&. " .ti -1c .RI "int \fBglobus_thread_key_create\fP (\fBglobus_thread_key_t\fP *key, \fBglobus_thread_key_destructor_func_t\fP func)" .br .RI "Create a key for thread-specific storage\&. " .ti -1c .RI "int \fBglobus_thread_key_delete\fP (\fBglobus_thread_key_t\fP key)" .br .RI "Delete a thread-local storage key\&. " .ti -1c .RI "int \fBglobus_thread_once\fP (\fBglobus_thread_once_t\fP *once, void(*init_routine)(void))" .br .RI "Execute a function one time\&. " .ti -1c .RI "void \fBglobus_thread_yield\fP (void)" .br .RI "Yield execution to another thread\&. " .ti -1c .RI "int \fBglobus_thread_sigmask\fP (int how, const sigset_t *newmask, sigset_t *oldmask)" .br .RI "Modify the current thread's signal mask\&. " .ti -1c .RI "int \fBglobus_thread_kill\fP (\fBglobus_thread_t\fP thread, int sig)" .br .RI "Send a signal to a thread\&. " .ti -1c .RI "void \fBglobus_thread_exit\fP (void *value)" .br .RI "Terminate the current thread\&. " .ti -1c .RI "\fBglobus_thread_t\fP \fBglobus_thread_self\fP (void)" .br .RI "Determine the current thread's ID\&. " .ti -1c .RI "int \fBglobus_thread_equal\fP (\fBglobus_thread_t\fP thread1, \fBglobus_thread_t\fP thread2)" .br .RI "Check whether thread identifiers match\&. " .ti -1c .RI "\fBglobus_bool_t\fP \fBglobus_i_am_only_thread\fP (void)" .br .RI "Determine if threads are supported\&. " .ti -1c .RI "\fBglobus_bool_t\fP \fBglobus_thread_preemptive_threads\fP (void)" .br .RI "Indicate whether the active thread model supports preemption\&. " .ti -1c .RI "void * \fBglobus_thread_cancellable_func\fP (void *(*func)(void *), void *arg, void(*cleanup_func)(void *), void *cleanup_arg, \fBglobus_bool_t\fP execute_cleanup)" .br .RI "Execute a function with thread cleanup in case of cancellation\&. " .ti -1c .RI "int \fBglobus_thread_cancel\fP (\fBglobus_thread_t\fP thr)" .br .RI "Cancel a thread\&. " .ti -1c .RI "void \fBglobus_thread_testcancel\fP (void)" .br .RI "Thread cancellation point\&. " .ti -1c .RI "int \fBglobus_thread_setcancelstate\fP (int state, int *oldstate)" .br .RI "Set the thread's cancellable state\&. " .in -1c .SH "Detailed Description" .PP Globus Threading Abstraction\&. Globus threads package which can work with either pthreads or without threads, depending on runtime configuration .SH "Author" .PP Generated automatically by Doxygen for globus_common from the source code\&.