tevent immediate events

Stefan (metze) Metzmacher metze at samba.org
Fri Mar 13 11:40:39 GMT 2009


Hi,

We have some usecases for directly triggered timed events
where we can't do proper reporting of allocation errors.

I'd like to propose to add new event class for immediately triggered
events:

typedef void (*tevent_immediate_handler_t)(struct tevent_context *ctx,
                                           struct tevent_immediate *im,
                                           void *private_data);
struct tevent_immediate *tevent_allocate_immediate(TALLOC_CTX *mem_ctx);
void tevent_schedule_immediate(struct tevent_context *ctx,
                               struct tevent_immediate *im,
                               tevent_immediate_handler_t handler,
                               void *private_data);

The caller allocated the tevent_immediate structure once and can
then schedule() it when needed. Once the event is triggered it's
detached from the tevent_context again. The caller can reuse it later.

if the schedule function is called while the event was still scheduled,
it will be detached from the old tevent_context and attached to the new
context.

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://lists.samba.org/archive/samba-technical/attachments/20090313/ae6e783f/signature.bin


More information about the samba-technical mailing list