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:18:55 +0200
commitbc0d2a41b8e7b8549ddb3161596013bfef91fd77 (patch)
treea2ec48071f243457db1d0ca001ccbff04341795e /src/providers/dp_ptask.h
parente1ac5897cd266d054ba3045dfed8a36a95901d81 (diff)
downloadsssd-bc0d2a41b8e7b8549ddb3161596013bfef91fd77.tar.gz
sssd-bc0d2a41b8e7b8549ddb3161596013bfef91fd77.tar.xz
sssd-bc0d2a41b8e7b8549ddb3161596013bfef91fd77.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);