Add a waitfor action to a condition
#include <ha/ham.h> ham_action_t *ham_action_waitfor( ham_condition_t *chdl, const char *aname, const char *path, int delay, unsigned flags);
libham
The ham_action_waitfor() function adds an action (aname) to a given condition. In this case, the action is one that lets you insert arbitrary delays into a sequence of actions.
The waitfor call fails if the specified path does not appear in the specified interval.
The handle (chdl) is obtained either:
or:
You use the delay parameter to specify the “waitfor” period in milliseconds.
You can also specify a path in order to control the delay. If path is specified, then the action waits for either the pathname to appear in the namespace or for the period specified in delay, whichever is lower.
Currently the following flag is defined:
A valid handle to an action to a condition, or NULL if an error occurred (errno is set).
The connection to the HAM is invalid. This happens when the process that opened the connection (using ham_connect()) and the process that's calling ham_action_waitfor() aren't the same.
The delay specified is invalid. Only values greater than zero are permitted.
The condition into which the action is being added has the HCONDNOWAIT set.
In addition to the above errors, the HAM returns any error it encounters while servicing this request.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
ham_action_execute(), ham_action_notify_pulse(), ham_action_notify_signal(), ham_action_remove(), ham_action_restart(), ham_condition(), ham_condition_handle()