[libdispatch-changes] [74] trunk/src/source.c

source_changes at macosforge.org source_changes at macosforge.org
Sat Oct 31 04:15:12 PDT 2009


Revision: 74
          http://trac.macosforge.org/projects/libdispatch/changeset/74
Author:   robert at fledge.watson.org
Date:     2009-10-31 04:15:09 -0700 (Sat, 31 Oct 2009)
Log Message:
-----------
Introduce _dispatch_source_kevent_resume() to avoid direct use of
dispatch_kevent_t in source.c, making it easier to do an alternative
event management backend on systems not supporting kqueue.

Submitted by:	Paolo Bonzini <bonzini at gnu.org>

Modified Paths:
--------------
    trunk/src/source.c

Modified: trunk/src/source.c
===================================================================
--- trunk/src/source.c	2009-10-31 10:54:16 UTC (rev 73)
+++ trunk/src/source.c	2009-10-31 11:15:09 UTC (rev 74)
@@ -90,6 +90,7 @@
 static size_t _dispatch_source_debug(dispatch_source_t ds, char* buf, size_t bufsiz);
 static size_t dispatch_source_debug_attr(dispatch_source_t ds, char* buf, size_t bufsiz);
 static dispatch_queue_t _dispatch_source_invoke(dispatch_source_t ds);
+static void _dispatch_source_kevent_resume(dispatch_source_t ds, uint32_t new_flags, uint32_t del_flags);
 
 static void _dispatch_kevent_merge(dispatch_source_t ds);
 static void _dispatch_kevent_release(dispatch_source_t ds);
@@ -313,7 +314,7 @@
 	// by the dispatch kevent
 	if (do_resume) {
 		dk->dk_kevent.flags |= EV_ADD;
-		_dispatch_kevent_resume(ds->ds_dkev, new_flags, 0);
+		_dispatch_source_kevent_resume(ds, new_flags, 0);
 		ds->ds_is_armed = true;
 	}
 }
@@ -347,6 +348,12 @@
 	}
 }
 
+void
+_dispatch_source_kevent_resume(dispatch_source_t ds, uint32_t new_flags, uint32_t del_flags)
+{
+	_dispatch_kevent_resume(ds->ds_dkev, new_flags, del_flags);
+}
+
 dispatch_queue_t
 _dispatch_source_invoke(dispatch_source_t ds)
 {
@@ -397,7 +404,7 @@
 		if (dq != &_dispatch_mgr_q) {
 			return &_dispatch_mgr_q;
 		}
-		_dispatch_kevent_resume(ds->ds_dkev, 0, 0);
+		_dispatch_source_kevent_resume(ds, 0, 0);
 		ds->ds_is_armed = true;
 	}
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/libdispatch-changes/attachments/20091031/487293a4/attachment.html>


More information about the libdispatch-changes mailing list