This allows us to re-initialise a tevent context without destroying
the pointer. That means that if someone keeps a long term ptr to the
event context across a fork it will still work.
This also brings the memory handling in single and standard process
models much closer together, which means less bugs that we don't find
with make test.
{
return ev->ops->loop_wait(ev, location);
}
+
+
+/*
+ re-initialise a tevent context. This leaves you with the same
+ event context, but all events are wiped and the structure is
+ re-initialised. This is most useful after a fork()
+
+ zero is returned on success, non-zero on failure
+*/
+int tevent_re_initialise(struct tevent_context *ev)
+{
+ tevent_common_context_destructor(ev);
+
+ return ev->ops->context_init(ev);
+}
_tevent_loop_until(ev, finished, private_data, __location__)
#endif
+int tevent_re_initialise(struct tevent_context *ev);
+
/**
* The following structure and registration functions are exclusively