Niels Provos wrote:
On Thu, Dec 4, 2008 at 2:15 PM, Matthew Weigel <[EMAIL PROTECTED]> wrote:
I'm still digging around in here, if I find much more to add I'll probably
submit a documentation patch.
EV_READ, EV_WRITE are mutually exclusive with EV_SIGNAL.
The confusion arises from everything going via event_set, even if the
user used evsignal_set instead.
If you have suggestions on how to make the text easier to understand,
please let me know.
Niels.
Just so you know, it looks like when you CC: libevent-users your message
isn't included in the archive at monkeymail.org. I noticed it with your
last response when I was trying to get the build to work on Windows, and
I noticed again with this message.
Looking at the code, it looks like the opposite of what you wrote is
true - everything goes through event_set, even if internally it gets
passed to evsignal_add. I did realize after I wrote the proposed change
that EV_SIGNAL is incompatible with EV_READ and EV_WRITE, but it still
seems like event_set is the place to document how to use EV_SIGNAL...
it's certainly not documented anywhere else.
The other option seems to be to provide a #define of event_set to
event_signal_set which does the same thing, but allows you to separate
the documentation of the two behaviors, making them both more clear.
How's this?
"The events can be EV_READ, EV_WRITE, EV_READ and EV_WRITE, or
EV_SIGNAL. This indicates that an application can read from or write to
the provided file descriptor. In the case of EV_SIGNAL, the file
descriptor is interpreted as a signal to catch instead of a file
descriptor. The additional flag EV_PERSIST makes an event_add()
persistent until event_del() has been called.
"The function fn will be called with the file descriptor that triggered
the event and the type of event which will be either EV_TIMEOUT,
EV_SIGNAL, EV_READ, or EV_WRITE."
--
Matthew Weigel
hacker
unique & idempot . ent
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkeymail.org/mailman/listinfo/libevent-users