19 #if !defined GLOBUS_THREAD_WINDOWS_H
20 #define GLOBUS_THREAD_WINDOWS_H
27 #define GLOBUS_NULL_POINTER_PARAMETER -1
28 #define globus_thread_once_t int
29 #define GLOBUS_THREAD_ONCE_INIT 0
30 #define GLOBUS_THREAD_ONCE_CALLED 1
33 typedef void * (*globus_thread_func_t)(
void *user_arg);
36 typedef struct globus_thread_key_s
42 typedef struct globus_i_thread_t
44 unsigned long threadID;
45 UserFunctionInfo userFunctionInfo;
53 typedef struct __globus_threadattr_t
55 void * threadAttribute;
58 typedef struct _globus_mutexattr_t
60 LPSECURITY_ATTRIBUTES securityAttributes;
65 typedef struct _globus_condattr_t
67 LPSECURITY_ATTRIBUTES securityAttributes;
70 typedef struct _globus_cond_t
85 globus_thread_func_t func,
89 #define globus_macro_i_am_only_thread() GLOBUS_FALSE
104 void (*init_routine)(
void));
127 globus_abstime_t * abstime);
141 extern int globus_i_thread_pre_activate();
145 #define GLOBUS_THREAD_MODULE (&globus_i_thread_module)
Thread ID.
Definition: globus_thread.h:71
int globus_cond_timedwait(globus_cond_t *cond, globus_mutex_t *mutex, globus_abstime_t *abstime)
Wait for a condition to be signalled.
Definition: globus_thread.c:623
globus_bool_t globus_i_am_only_thread(void)
Determine if threads are supported.
Definition: globus_thread.c:1614
int globus_cond_broadcast(globus_cond_t *cond)
Signal a condition to multiple threads.
Definition: globus_thread.c:697
int globus_cond_wait(globus_cond_t *cond, globus_mutex_t *mutex)
Wait for a condition to be signalled.
Definition: globus_thread.c:571
int globus_mutexattr_destroy(globus_mutexattr_t *attr)
Destroy a mutex attribute.
Definition: globus_thread.c:775
int globus_thread_key_delete(globus_thread_key_t key)
Delete a thread-local storage key.
Definition: globus_thread.c:1123
int globus_cond_destroy(globus_cond_t *cond)
Destroy a condition variable.
Definition: globus_thread.c:526
globus_thread_once_t once_control
Definition: module.c:121
Thread attributes.
Definition: globus_thread.h:88
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
int globus_mutex_destroy(globus_mutex_t *mutex)
Destroy a mutex.
Definition: globus_thread.c:305
void(* globus_thread_key_destructor_func_t)(void *value)
Thread-specific data destructor.
Definition: globus_thread.h:195
Reference Counting Module Activation and Deactivation.
int globus_mutex_init(globus_mutex_t *mutex, globus_mutexattr_t *attr)
Initialize a mutex.
Definition: globus_thread.c:267
void * globus_thread_getspecific(globus_thread_key_t key)
Get a thread-specific data value.
Definition: globus_thread.c:1269
int globus_cond_init(globus_cond_t *cond, globus_condattr_t *attr)
Initialize a condition variableThe globus_cond_init() function creates a condition variable that can ...
Definition: globus_thread.c:487
int globus_thread_setspecific(globus_thread_key_t key, void *value)
Set a thread-specific data value.
Definition: globus_thread.c:1331
List data type.
Definition: globus_list.h:44
Thread once structure.
Definition: globus_thread.h:226
Mutex.
Definition: globus_thread.h:107
int globus_mutexattr_init(globus_mutexattr_t *attr)
Initialize a mutex attribute.
Definition: globus_thread.c:737
globus_thread_t globus_thread_self(void)
Determine the current thread's ID.
Definition: globus_thread.c:1513
int globus_mutex_unlock(globus_mutex_t *mutex)
Unlock a mutex.
Definition: globus_thread.c:388
void globus_thread_yield(void)
Yield execution to another thread.
Definition: globus_thread.c:1362
Condition variable.
Definition: globus_thread.h:124
int globus_condattr_destroy(globus_condattr_t *cond_attr)
Destroy a condition attribute.
Definition: globus_thread.c:852
Condition variable attribute.
Definition: globus_thread.h:171
int globus_condattr_init(globus_condattr_t *cond_attr)
Initialize a condition variable attribute.
Definition: globus_thread.c:814
int globus_thread_once(globus_thread_once_t *once, void(*init_routine)(void))
Execute a function one time.
Definition: globus_thread.c:1206
Thread-specific data key.
Definition: globus_thread.h:201
void globus_thread_exit(void *value)
Terminate the current thread.
Definition: globus_thread.c:1386
int globus_thread_key_create(globus_thread_key_t *key, globus_thread_key_destructor_func_t destructor)
Create a key for thread-specific storage.
Definition: globus_thread.c:1081
int globus_thread_cancel(globus_thread_t thr)
Cancel a thread.
Definition: globus_thread.c:1709
int globus_mutex_lock(globus_mutex_t *mutex)
Lock a mutex.
Definition: globus_thread.c:347
globus_bool_t globus_thread_equal(globus_thread_t thread1, globus_thread_t thread2)
Check whether thread identifiers match.
Definition: globus_thread.c:1552
int globus_mutex_trylock(globus_mutex_t *mutex)
Lock a mutex if it is not locked.
Definition: globus_thread.c:431
int globus_thread_create(globus_thread_t *thread, globus_threadattr_t *attr, globus_thread_func_t func, void *user_arg)
Create a new thread.
Definition: globus_thread.c:998
int globus_cond_signal(globus_cond_t *cond)
Signal a condition to a thread.
Definition: globus_thread.c:661
Module Descriptor.
Definition: globus_module.h:71
Mutex attribute.
Definition: globus_thread.h:151