summaryrefslogtreecommitdiffstats
path: root/src/providers/dp_ptask.h
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-10-24 11:30:09 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-10-25 22:12:19 +0200
commit4d6edda295ff05825d924f0450d2c2bf2034c357 (patch)
tree6eb4d0c57faf8d4bb95b7203a1c52a92370d9ecb /src/providers/dp_ptask.h
parentd19e343d3fcb0780300d69ba5813ca4762ca9b98 (diff)
downloadsssd-4d6edda295ff05825d924f0450d2c2bf2034c357.tar.gz
sssd-4d6edda295ff05825d924f0450d2c2bf2034c357.tar.xz
sssd-4d6edda295ff05825d924f0450d2c2bf2034c357.zip
be_ptask: add be_ptask_create_sync()
This is a wrapper around be_ptask_create() that allows to create synchronous periodic tasks. Resolves: https://fedorahosted.org/sssd/ticket/1968
Diffstat (limited to 'src/providers/dp_ptask.h')
-rw-r--r--src/providers/dp_ptask.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/providers/dp_ptask.h b/src/providers/dp_ptask.h
index 6a241fb7a..11324db74 100644
--- a/src/providers/dp_ptask.h
+++ b/src/providers/dp_ptask.h
@@ -61,6 +61,17 @@ typedef errno_t
(*be_ptask_recv_t)(struct tevent_req *req);
/**
+ * If EOK, task will be scheduled again to 'last_execution_time + period'.
+ * If other error code, task will be rescheduled to 'now + period'.
+ */
+typedef errno_t
+(*be_ptask_sync_t)(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct be_ctx *be_ctx,
+ struct be_ptask *be_ptask,
+ void *pvt);
+
+/**
* The first execution is scheduled first_delay seconds after the task is
* created.
*
@@ -85,6 +96,18 @@ errno_t be_ptask_create(TALLOC_CTX *mem_ctx,
const char *name,
struct be_ptask **_task);
+errno_t be_ptask_create_sync(TALLOC_CTX *mem_ctx,
+ struct be_ctx *be_ctx,
+ time_t period,
+ time_t first_delay,
+ time_t enabled_delay,
+ time_t timeout,
+ enum be_ptask_offline offline,
+ be_ptask_sync_t fn,
+ void *pvt,
+ const char *name,
+ struct be_ptask **_task);
+
void be_ptask_enable(struct be_ptask *task);
void be_ptask_disable(struct be_ptask *task);
void be_ptask_destroy(struct be_ptask **task);