Grid Community Toolkit  6.2.1541705016
Macros | Typedefs | Enumerations | Functions
globus_callback.h File Reference

Globus Callback API. More...

#include "globus_common_include.h"
#include "globus_module.h"
#include "globus_time.h"

Go to the source code of this file.

Macros

#define GLOBUS_CALLBACK_MODULE
 Module descriptor. More...
 
#define GLOBUS_POLL_MODULE
 Module descriptor. More...
 
#define GLOBUS_CALLBACK_GLOBAL_SPACE
 Global callback space. More...
 
#define GLOBUS_SIGNAL_INTERRUPT
 
Convenience Macros
#define globus_callback_poll(a)
 Poll the global callback space. More...
 
#define globus_poll_blocking()
 Blocking poll of the global callback space. More...
 
#define globus_poll_nonblocking()
 Nonblocking poll of the global callback space. More...
 
#define globus_poll()
 Nonblocking poll of the global callback space. More...
 
#define globus_signal_poll()
 Wake up callback polling thread. More...
 
#define globus_callback_register_oneshot( callback_handle, delay_time, callback_func, callback_user_arg)
 Register a oneshot function in the global callback space. More...
 
#define globus_callback_register_periodic( callback_handle, delay_time, period, callback_func, callback_user_arg)
 Register a periodic function in the global callback space. More...
 
#define globus_callback_register_signal_handler( signum, persist, callback_func, callback_user_arg)
 Register a signal handler in the global callback space. More...
 

Typedefs

typedef int globus_callback_handle_t
 Periodic callback handle. More...
 
typedef int globus_callback_space_t
 Callback space handle. More...
 
typedef struct globus_l_callback_space_attr_s * globus_callback_space_attr_t
 Callback space attribute. More...
 
Callback Prototypes
typedef void(* globus_callback_func_t) (void *user_arg)
 Globus callback prototype. More...
 

Enumerations

enum  globus_callback_error_type_t {
  GLOBUS_CALLBACK_ERROR_INVALID_CALLBACK_HANDLE = 1024, GLOBUS_CALLBACK_ERROR_INVALID_SPACE, GLOBUS_CALLBACK_ERROR_MEMORY_ALLOC, GLOBUS_CALLBACK_ERROR_INVALID_ARGUMENT,
  GLOBUS_CALLBACK_ERROR_ALREADY_CANCELED, GLOBUS_CALLBACK_ERROR_NO_ACTIVE_CALLBACK
}
 Error types. More...
 
enum  globus_callback_space_behavior_t { GLOBUS_CALLBACK_SPACE_BEHAVIOR_SINGLE, GLOBUS_CALLBACK_SPACE_BEHAVIOR_SERIALIZED, GLOBUS_CALLBACK_SPACE_BEHAVIOR_THREADED }
 Callback space behaviors describe how a space behaves. More...
 

Functions

globus_result_t globus_callback_space_init (globus_callback_space_t *space, globus_callback_space_attr_t attr)
 Initialize a user space. More...
 
globus_result_t globus_callback_space_reference (globus_callback_space_t space)
 Take a reference to a space. More...
 
globus_result_t globus_callback_space_destroy (globus_callback_space_t space)
 Destroy a reference to a user space. More...
 
globus_result_t globus_callback_space_attr_init (globus_callback_space_attr_t *attr)
 Initialize a space attr. More...
 
globus_result_t globus_callback_space_attr_destroy (globus_callback_space_attr_t attr)
 Destroy a space attr. More...
 
globus_result_t globus_callback_space_attr_set_behavior (globus_callback_space_attr_t attr, globus_callback_space_behavior_t behavior)
 Set the behavior of a space. More...
 
globus_result_t globus_callback_space_attr_get_behavior (globus_callback_space_attr_t attr, globus_callback_space_behavior_t *behavior)
 Get the behavior associated with an attr. More...
 
globus_result_t globus_callback_space_get (globus_callback_space_t *space)
 Retrieve the space of a currently running callback. More...
 
int globus_callback_space_get_depth (globus_callback_space_t space)
 Retrieve the current nesting level of a space. More...
 
globus_bool_t globus_callback_space_is_single (globus_callback_space_t space)
 See if the specified space is a single threaded behavior space. More...
 
globus_result_t globus_callback_space_register_signal_handler (int signum, globus_bool_t persist, globus_callback_func_t callback_func, void *callback_user_arg, globus_callback_space_t space)
 Fire a callback when the specified signal is received. More...
 
globus_result_t globus_callback_unregister_signal_handler (int signum, globus_callback_func_t unregister_callback, void *unreg_arg)
 Unregister a signal handling callback. More...
 
void globus_callback_add_wakeup_handler (void(*wakeup)(void *), void *user_arg)
 Register a wakeup handler with callback library. More...
 
Oneshot Callbacks
globus_result_t globus_callback_space_register_oneshot (globus_callback_handle_t *callback_handle, const globus_reltime_t *delay_time, globus_callback_func_t callback_func, void *callback_user_arg, globus_callback_space_t space)
 Register a oneshot some delay from now. More...
 
Periodic Callbacks
globus_result_t globus_callback_space_register_periodic (globus_callback_handle_t *callback_handle, const globus_reltime_t *delay_time, const globus_reltime_t *period, globus_callback_func_t callback_func, void *callback_user_arg, globus_callback_space_t space)
 Register a periodic callback. More...
 
globus_result_t globus_callback_unregister (globus_callback_handle_t callback_handle, globus_callback_func_t unregister_callback, void *unreg_arg, globus_bool_t *active)
 Unregister a callback. More...
 
globus_result_t globus_callback_adjust_oneshot (globus_callback_handle_t callback_handle, const globus_reltime_t *new_delay)
 Adjust the delay of a oneshot callback. More...
 
globus_result_t globus_callback_adjust_period (globus_callback_handle_t callback_handle, const globus_reltime_t *new_period)
 Adjust the period of a periodic callback. More...
 
Callback Polling
void globus_callback_space_poll (const globus_abstime_t *timestop, globus_callback_space_t space)
 Poll for ready callbacks. More...
 
void globus_callback_signal_poll ()
 Signal the poll. More...
 
Miscellaneous
globus_bool_t globus_callback_get_timeout (globus_reltime_t *time_left)
 Get the amount of time left in a callback. More...
 
globus_bool_t globus_callback_has_time_expired ()
 See if there is remaining time in a callback. More...
 
globus_bool_t globus_callback_was_restarted ()
 See if a callback has been restarted. More...
 

Detailed Description

Globus Callback API.