diff src/lib/ioloop.h @ 4579:40b353def38c HEAD

OK, so the original kqueue code wasn't actually broken, but it could have been made much simpler. Updated comments in ioloop.h about IO_READ and IO_ERROR usage.
author Timo Sirainen <tss@iki.fi>
date Thu, 17 Aug 2006 21:46:42 +0300
parents 49e024519e22
children 204d7edc7cdc
line wrap: on
line diff
--- a/src/lib/ioloop.h	Thu Aug 17 21:17:38 2006 +0300
+++ b/src/lib/ioloop.h	Thu Aug 17 21:46:42 2006 +0300
@@ -11,6 +11,8 @@
 enum io_condition {
 	IO_READ		= 0x01,
 	IO_WRITE	= 0x02,
+	/* IO_ERROR can be used to check when writable pipe's reader side
+	   closes the pipe. For other uses IO_READ should work just as well. */
 	IO_ERROR	= 0x04,
 	
 	/* internal */
@@ -28,11 +30,11 @@
 
 extern struct ioloop *current_ioloop;
 
-/* I/O listeners - you can create different handlers for IO_READ and IO_WRITE,
-   but make sure you don't create multiple handlers of same type, it's not
-   checked and removing one will stop the other from working as well.
+/* You can create different handlers for IO_READ and IO_WRITE. IO_READ and
+   IO_ERROR can't use different handlers (and there's no point anyway).
 
- */
+   Don't try to add multiple handlers for the same type. It's not checked and
+   the behavior will be undefined. */
 struct io *io_add(int fd, enum io_condition condition,
 		  io_callback_t *callback, void *context);
 struct io *io_add_notify(const char *path, io_callback_t *callback,