summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent_timed.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-01-02 13:26:32 +0100
committerStefan Metzmacher <metze@samba.org>2009-01-02 18:16:52 +0100
commit227f799dee4e59479612bcb3dc96231589515051 (patch)
treec34f1315b813775038c9c1bc2b5038a90e53fae2 /lib/tevent/tevent_timed.c
parent49acf9799aab288b4e585295eb7c44a719973945 (diff)
downloadsamba-227f799dee4e59479612bcb3dc96231589515051.tar.gz
samba-227f799dee4e59479612bcb3dc96231589515051.tar.bz2
samba-227f799dee4e59479612bcb3dc96231589515051.zip
tevent: pass down handler_name and location to the backend layer
metze
Diffstat (limited to 'lib/tevent/tevent_timed.c')
-rw-r--r--lib/tevent/tevent_timed.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/tevent/tevent_timed.c b/lib/tevent/tevent_timed.c
index 4ad457221e..dadd360416 100644
--- a/lib/tevent/tevent_timed.c
+++ b/lib/tevent/tevent_timed.c
@@ -106,7 +106,7 @@ bool ev_timeval_is_zero(const struct timeval *tv)
/*
destroy a timed event
*/
-static int common_event_timed_destructor(struct tevent_timer *te)
+static int tevent_common_timed_destructor(struct tevent_timer *te)
{
struct tevent_context *ev = talloc_get_type(te->event_ctx,
struct tevent_context);
@@ -114,7 +114,7 @@ static int common_event_timed_destructor(struct tevent_timer *te)
return 0;
}
-static int common_event_timed_deny_destructor(struct tevent_timer *te)
+static int tevent_common_timed_deny_destructor(struct tevent_timer *te)
{
return -1;
}
@@ -123,10 +123,12 @@ static int common_event_timed_deny_destructor(struct tevent_timer *te)
add a timed event
return NULL on failure (memory allocation error)
*/
-struct tevent_timer *common_event_add_timed(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
- struct timeval next_event,
- event_timed_handler_t handler,
- void *private_data)
+struct tevent_timer *tevent_common_add_timer(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
+ struct timeval next_event,
+ tevent_timer_handler_t handler,
+ void *private_data,
+ const char *handler_name,
+ const char *location)
{
struct tevent_timer *te, *last_te, *cur_te;
@@ -137,6 +139,8 @@ struct tevent_timer *common_event_add_timed(struct tevent_context *ev, TALLOC_CT
te->next_event = next_event;
te->handler = handler;
te->private_data = private_data;
+ te->handler_name = handler_name;
+ te->location = location;
te->additional_data = NULL;
/* keep the list ordered */
@@ -152,7 +156,7 @@ struct tevent_timer *common_event_add_timed(struct tevent_context *ev, TALLOC_CT
DLIST_ADD_AFTER(ev->timer_events, te, last_te);
- talloc_set_destructor(te, common_event_timed_destructor);
+ talloc_set_destructor(te, tevent_common_timed_destructor);
return te;
}
@@ -163,7 +167,7 @@ struct tevent_timer *common_event_add_timed(struct tevent_context *ev, TALLOC_CT
return the delay untill the next timed event,
or zero if a timed event was triggered
*/
-struct timeval common_event_loop_timer_delay(struct tevent_context *ev)
+struct timeval tevent_common_loop_timer_delay(struct tevent_context *ev)
{
struct timeval current_time = ev_timeval_zero();
struct tevent_timer *te = ev->timer_events;
@@ -200,7 +204,7 @@ struct timeval common_event_loop_timer_delay(struct tevent_context *ev)
*/
/* deny the handler to free the event */
- talloc_set_destructor(te, common_event_timed_deny_destructor);
+ talloc_set_destructor(te, tevent_common_timed_deny_destructor);
/* We need to remove the timer from the list before calling the
* handler because in a semi-async inner event loop called from the