From cacd83983f20af59b9a137886131a63f834a06e9 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Wed, 1 Dec 2004 20:10:16 +0000 Subject: [PATCH] documentation on thread safe events svn:r126 --- event.3 | 13 ++++++++++++- event.h | 3 +++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/event.3 b/event.3 index c263a494..bfff5928 100644 --- a/event.3 +++ b/event.3 @@ -73,7 +73,7 @@ .Sh SYNOPSIS .Fd #include .Fd #include -.Ft void +.Ft "struct event_base *" .Fn "event_init" .Ft int .Fn "event_dispatch" @@ -399,6 +399,17 @@ By default, assigns the middle priority to all events unless their priority is explicitly set. .Pp +.Sh THREAD SAFE EVENTS +.Nm Libevent +has experimental support for thread-safe events. +When initializing the library via +.Fn event_init , +an event base is returned. +This event base can be used in conjunction with calls to +.Fn event_base_set +and +.Fn event_base_dispatch . +.Pp .Sh BUFFERED EVENTS .Nm libevent provides an abstraction on top of the regular event callbacks. diff --git a/event.h b/event.h index 05b56fe7..eb6b6663 100644 --- a/event.h +++ b/event.h @@ -129,6 +129,9 @@ void *event_init(void); int event_dispatch(void); int event_base_dispatch(struct event_base *); +/* Associate a different event base with an event */ +int event_base_set(struct event_base *, struct event *); + #define EVLOOP_ONCE 0x01 #define EVLOOP_NONBLOCK 0x02 int event_loop(int); -- 2.50.1