This is the main PIOMan interface, used to submit light tasks. More...
Data Structures | |
struct | piom_ltask |
Macros | |
#define | PIOM_LTASK_OPTION_NONE 0x00 |
#define | PIOM_LTASK_OPTION_REPEAT 0x01 |
repeat until task completion More... | |
#define | PIOM_LTASK_OPTION_ONESHOT 0x02 |
task is scheduled once More... | |
#define | PIOM_LTASK_OPTION_DESTROY 0x04 |
handler destroys the ltask- must be oneshot, without wait More... | |
#define | PIOM_LTASK_OPTION_NOWAIT 0x08 |
no wait will be performed on the task- bypass completion notification More... | |
#define | PIOM_LTASK_OPTION_BLOCKING 0x10 |
task has a blocking function More... | |
Typedefs | |
typedef unsigned | piom_ltask_option_t |
typedef int(* | piom_ltask_func_t) (void *arg) |
type for ltask callback function More... | |
Enumerations | |
enum | piom_ltask_state_t { PIOM_LTASK_STATE_NONE = 0x00 , PIOM_LTASK_STATE_READY = 0x01 , PIOM_LTASK_STATE_SCHEDULED = 0x02 , PIOM_LTASK_STATE_SUCCESS = 0x04 , PIOM_LTASK_STATE_TERMINATED = 0x08 , PIOM_LTASK_STATE_DESTROYED = 0x10 , PIOM_LTASK_STATE_BLOCKED = 0x20 , PIOM_LTASK_STATE_CANCELLED = 0x40 , PIOM_LTASK_STATE_MASKED = 0x80 } |
Functions | |
int | piom_ltask_test_activity (void) |
Tests whether the ltask system is running. More... | |
void | piom_ltask_submit (struct piom_ltask *task) |
submit a task Beyond this point, the task may be scheduled at any time More... | |
void | piom_ltask_wait_success (struct piom_ltask *task) |
Wait for the completion of a task (ie. More... | |
void | piom_ltask_wait (struct piom_ltask *task) |
Wait for the termination of a task (ie. More... | |
void | piom_ltask_cancel (struct piom_ltask *task) |
Cancel a task. More... | |
static piom_ltask_state_t | piom_ltask_state_set (struct piom_ltask *ltask, piom_ltask_state_t state) |
sets a given bit in a task state. More... | |
static piom_ltask_state_t | piom_ltask_state_unset (struct piom_ltask *ltask, piom_ltask_state_t state) |
unsets a given bit in a task state. More... | |
static int | piom_ltask_state_test (struct piom_ltask *ltask, piom_ltask_state_t state) |
test a given bit in a task state. More... | |
static void | piom_ltask_completed (struct piom_ltask *task) |
Notify task completion. More... | |
static void | piom_ltask_destroy (struct piom_ltask *ltask) |
Notify task destruction, if option DESTROY was set. More... | |
static void | piom_ltask_init (struct piom_ltask *ltask) |
static void | piom_ltask_create (struct piom_ltask *task, piom_ltask_func_t func_ptr, void *data_ptr, piom_ltask_option_t options) |
create a new ltask. More... | |
static void | piom_ltask_set_binding (struct piom_ltask *task, piom_topo_obj_t binding) |
void | piom_ltask_set_blocking (struct piom_ltask *task, piom_ltask_func_t func, int delay_usec) |
static void | piom_ltask_set_name (struct piom_ltask *ltask, const char *name) |
static void | piom_ltask_set_destructor (struct piom_ltask *ltask, void(*destructor)(struct piom_ltask *)) |
void | piom_ltask_poll_level_set (int level) |
set the polling level- 0 for low; 1 for high More... | |
int | piom_ltask_poll_level_get (void) |
void | piom_ltask_mask (struct piom_ltask *ltask) |
suspend the ltask scheduling More... | |
void | piom_ltask_unmask (struct piom_ltask *ltask) |
re-enable a previously masked ltask More... | |
int | piom_ltask_cancel_request (struct piom_ltask *ltask) |
asynchronously request task cancellation More... | |
void | piom_ltask_cancel_wait (struct piom_ltask *ltask) |
wait for cancellation completion More... | |
void | piom_ltask_cancel_immediate (struct piom_ltask *ltask) |
immediately cancel the ltask, without waiting for the scheduler to flush it from the queue More... | |
void | piom_ltask_assert_noschedule (void) |
assert we are not called from an ltask schedule context; only in DEBUG mode More... | |
void | piom_ltask_check_wait (void) |
check that we are in a context where we can wait More... | |
This is the main PIOMan interface, used to submit light tasks.
#define PIOM_LTASK_OPTION_BLOCKING 0x10 |
task has a blocking function
Definition at line 46 of file piom_ltask.h.
#define PIOM_LTASK_OPTION_DESTROY 0x04 |
handler destroys the ltask- must be oneshot, without wait
Definition at line 44 of file piom_ltask.h.
#define PIOM_LTASK_OPTION_NONE 0x00 |
Definition at line 41 of file piom_ltask.h.
#define PIOM_LTASK_OPTION_NOWAIT 0x08 |
no wait will be performed on the task- bypass completion notification
Definition at line 45 of file piom_ltask.h.
#define PIOM_LTASK_OPTION_ONESHOT 0x02 |
task is scheduled once
Definition at line 43 of file piom_ltask.h.
#define PIOM_LTASK_OPTION_REPEAT 0x01 |
repeat until task completion
Definition at line 42 of file piom_ltask.h.
typedef int(* piom_ltask_func_t) (void *arg) |
type for ltask callback function
Definition at line 62 of file piom_ltask.h.
typedef unsigned piom_ltask_option_t |
Definition at line 40 of file piom_ltask.h.
enum piom_ltask_state_t |
Definition at line 48 of file piom_ltask.h.
void piom_ltask_assert_noschedule | ( | void | ) |
assert we are not called from an ltask schedule context; only in DEBUG mode
void piom_ltask_cancel | ( | struct piom_ltask * | task | ) |
Cancel a task.
Slow! Use only for clean shutdown.
void piom_ltask_cancel_immediate | ( | struct piom_ltask * | ltask | ) |
immediately cancel the ltask, without waiting for the scheduler to flush it from the queue
int piom_ltask_cancel_request | ( | struct piom_ltask * | ltask | ) |
asynchronously request task cancellation
void piom_ltask_cancel_wait | ( | struct piom_ltask * | ltask | ) |
wait for cancellation completion
void piom_ltask_check_wait | ( | void | ) |
check that we are in a context where we can wait
|
inlinestatic |
Notify task completion.
< no wait will be performed on the task- bypass completion notification
Definition at line 146 of file piom_ltask.h.
References done, options, piom_cond_signal(), PIOM_LTASK_OPTION_NOWAIT, piom_ltask_state_set(), and PIOM_LTASK_STATE_SUCCESS.
|
inlinestatic |
create a new ltask.
< repeat until task completion
< task is scheduled once
< task is scheduled once
< handler destroys the ltask- must be oneshot, without wait
Definition at line 169 of file piom_ltask.h.
References binding, blocking_func, data_ptr, destructor, done, func_ptr, name, options, piom_cond_init(), PIOM_LTASK_OPTION_DESTROY, PIOM_LTASK_OPTION_ONESHOT, PIOM_LTASK_OPTION_REPEAT, PIOM_LTASK_STATE_NONE, queue, and state.
|
inlinestatic |
Notify task destruction, if option DESTROY was set.
Definition at line 156 of file piom_ltask.h.
References PIOM_LTASK_STATE_BLOCKED, PIOM_LTASK_STATE_DESTROYED, PIOM_LTASK_STATE_SCHEDULED, and state.
|
inlinestatic |
Definition at line 162 of file piom_ltask.h.
References PIOM_LTASK_STATE_NONE, queue, and state.
void piom_ltask_mask | ( | struct piom_ltask * | ltask | ) |
suspend the ltask scheduling
int piom_ltask_poll_level_get | ( | void | ) |
void piom_ltask_poll_level_set | ( | int | level | ) |
set the polling level- 0 for low; 1 for high
|
inlinestatic |
Definition at line 188 of file piom_ltask.h.
References binding.
void piom_ltask_set_blocking | ( | struct piom_ltask * | task, |
piom_ltask_func_t | func, | ||
int | delay_usec | ||
) |
|
inlinestatic |
< no wait will be performed on the task- bypass completion notification
Definition at line 200 of file piom_ltask.h.
References destructor, options, and PIOM_LTASK_OPTION_NOWAIT.
|
inlinestatic |
Definition at line 195 of file piom_ltask.h.
References name.
|
inlinestatic |
sets a given bit in a task state.
Definition at line 109 of file piom_ltask.h.
References state.
Referenced by piom_ltask_completed().
|
inlinestatic |
|
inlinestatic |
unsets a given bit in a task state.
Definition at line 125 of file piom_ltask.h.
References state.
void piom_ltask_submit | ( | struct piom_ltask * | task | ) |
submit a task Beyond this point, the task may be scheduled at any time
int piom_ltask_test_activity | ( | void | ) |
Tests whether the ltask system is running.
return 1 if running, 0 otherwise
void piom_ltask_unmask | ( | struct piom_ltask * | ltask | ) |
re-enable a previously masked ltask
void piom_ltask_wait | ( | struct piom_ltask * | task | ) |
Wait for the termination of a task (ie.
wait until the task state matches PIOM_LTASK_STATE_TERMINATED)
void piom_ltask_wait_success | ( | struct piom_ltask * | task | ) |
Wait for the completion of a task (ie.
wait until the task state matches PIOM_LTASK_STATE_SUCCESS)