Commit Graph

455 Commits

Author SHA1 Message Date
mheily
74b37975ae By default, kevent() will serialize the copyout() and copyin() functions so that only one thread can operate on a kevent structure. This is controlled by the SERIALIZE_KEVENT macro. This temporarily
restores the behavior from libkqueue 1.0 to give us time to implement
fine-grained locking properly.

New functions: kqueue_lock() and kqueue_unlock().


git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@484 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-18 01:41:26 +00:00
marius
86b1fbb760 EVTFILT_TIMER working on windows
Added binary files on windows to svn:ignore

git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@483 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-17 19:34:34 +00:00
marius
dc2761332f Added CMakeLists.txt for libkqueue and tests
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@482 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-16 08:57:12 +00:00
marius
c4a997e8d5 Add option for static library build activated by defining MAKE_STATIC
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@481 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-16 08:54:17 +00:00
mheily
89f858788f Testing SVN post-commit hook
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@480 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-14 01:12:48 +00:00
mheily
cee1de5c60 Test commit, trying a post-commit email notify hook
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@479 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-14 00:58:03 +00:00
mheily
252e29883a Test commit, trying a post-commit email notify hook
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@478 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-14 00:56:09 +00:00
mheily
d417316168 Document test failure on SunOS
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@477 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-14 00:53:06 +00:00
mheily
a00bd06d97 Use calloc() instead of malloc() to avoid the use of uninitialized memory.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@476 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-14 00:42:11 +00:00
mheily
650452c28f Fix format string type mismatch
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@475 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-14 00:25:27 +00:00
mheily
09aa72ecd1 Provide missing atomic_ptr_cas definition on some platforms.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@474 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-14 00:21:11 +00:00
marius
9abd0fc49c Made libkqueue compile on windows again - functionality still broken on this platform
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@473 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-13 17:35:34 +00:00
marius
0abf2a781a Fixed a bug within kevent_copyin_one() causing a knote mutex to be used after releasing the knote
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@472 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-13 17:24:19 +00:00
marius
3a1f03e6ae Added clean initialization and destruction to mutex used within a knote.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@471 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-13 17:23:13 +00:00
marius
0fb0ab9c2b Test commit as marius@
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@470 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-13 01:14:30 +00:00
mheily
e045e4a70c Fix incorrect "nfds" argument supplied to pselect(2)
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@469 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-11 03:17:37 +00:00
mheily
0d4298cce9 Fix conditional that invokes linux_kevent_wait_hires()
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@468 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-09 02:55:07 +00:00
mheily
10ec7ad485 Add a test for high-resolution kevent() calls on Linux
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@467 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-09 01:24:59 +00:00
mheily
4e607edd42 Support regular files with EVFILT_READ, fixes the dispatch_read test in libdispatch
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@466 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-06 02:49:48 +00:00
mheily
844e70a5f2 Disable debugging if KQUEUE_DEBUG is an empty string
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@465 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-06 01:51:39 +00:00
mheily
855362d95f Split socket.c into two separate files: read.c and write.c. This means that EVFILT_READ and EVFILT_WRITE are now completely separate filters.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@464 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-05 22:22:48 +00:00
mheily
2b21880288 Move knote_get_socket_type() into linux/socket.c.
Partial support for EVFILT_READ with regular files.



git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@463 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-04-05 21:17:21 +00:00
mheily
50bb5cb827 WORKAROUND: signalfd(2) flags are broken on kernels older than Linux 2.6.27
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@458 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-19 14:28:29 +00:00
mheily
c8762ecddb Fix another 32-bit compilation issue
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@457 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-19 14:11:59 +00:00
jocke
8ce2f93c30 Reverting to using port_getn, but checking nget even in case of error, as events might have been returned. See http://code.google.com/p/gdnsd/source/browse/branches/current/gdnsd/libgdnsd/libev/ev_port.c?spec=svn878&r=878 as well as related links for background...
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@456 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-15 09:30:39 +00:00
jocke
b1ddd1f071 Try using port_get rather than port_getn as we seem to sometime get lost wakeups for user events, there are a few problems reported for port_getn (http://bugs.opensolaris.org/view_bug.do?bug_id=6268715, http://mail.opensolaris.org/pipermail/networking-discuss/2009-August/011979.html, ...) - will use this for stress testing and see if it fixes the problem.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@455 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-15 08:34:57 +00:00
mheily
543ba08bf2 Document a Linux bug
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@454 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-12 17:01:51 +00:00
mheily
6b6ead7801 Move all debugging macros to a single debug.h header to allow them to be reused in other projects
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@452 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-07 04:46:46 +00:00
mheily
311318db25 Fix a build failure on Linux
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@451 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-07 04:24:03 +00:00
jocke
1e3117304f Remove superfluous newline in debug
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@450 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-03 13:41:32 +00:00
jocke
1bda0408db Make sure that EV_RECEIPT events also calls kn_modify(), as we may get NOTE_TRIGGER updates there that needs to trigger e.g. timers.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@449 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-03 07:05:01 +00:00
jocke
adb6951527 Temporarily disable alloc cache, as it is not threadsafe unless each thread has called mem_init(), which is hard to ensure. The problem is that a different thread may call knote_free() which never before called mem_init(), and then we make libdispatch crash in its internals... Will try to stabilize all libdispatch tests before trying to reenable this...
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@448 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-02 16:31:21 +00:00
jocke
2f1fc4353d Additional debug for port_associate.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@447 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-02 13:22:39 +00:00
jocke
6f1f8d9c78 Use same formatting for dbg_perror as for the other dbg_xxx functions.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@446 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-02 13:20:59 +00:00
jocke
46a437e3d7 Properly return number of available from fd on Solaris in evfilt_socket_copyout.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@445 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-02 10:37:08 +00:00
jocke
0b50f2ac45 Added xcode project for convenience for edit/navigation/etc
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@444 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-03-02 08:47:07 +00:00
jocke
96365c3031 Make sure we don't 'return' non-initialized events when running with KQUEUE_DEBUG by initializing rv properly (it would generate incorrect debug logs if nevents == 0), tuning debug output slightly.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@443 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-28 14:45:20 +00:00
jocke
e558ed245c Properly return number of times a timer have been triggered
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@442 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-28 09:26:14 +00:00
jocke
d058d2be8a Only map in memory enough to keep the possible set of file descriptors (rlim_max for RLIMIT_NOFILE) rather than MAX_INT, drastically decreases the needed amount of VM backing availble (allowing it to run on also swap-impaired machines). This should be correct, as the kq_id refers to an fd and we can't have more fd:s than this.
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@441 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-23 17:11:47 +00:00
jocke
2070c271dd Honor CC environment variable as the first pick in the compiler list, temporarily commented out the test for it being executable as it doesn't work properly when CC is set due to how finalize() checks for being empty
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@440 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-23 16:48:57 +00:00
mheily
89c42b63e8 Upgrade to makeconf r10.
Always use -shared when running the linker (fixes Linux build).

git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@439 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-23 01:41:22 +00:00
mheily
2c5f16b717 Emulate spinlocks on win32
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@438 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-23 01:33:55 +00:00
jocke
b073efbd81 Typecast instead of comment out s->st_count for the time being
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@437 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-21 17:54:08 +00:00
jocke
89717f7c0a Fix Solaris build - use -shared for Solaris ldflags to build shlib for now, comment out usage of st_count as the 32-bit Solaris atomic ops will bail out on the type sig_atomic_t
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@436 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-21 13:28:44 +00:00
mheily
49857606f7 backport "distfile" from pthwq
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@435 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-21 00:06:42 +00:00
mheily
c0f13a4fc9 all Solaris tests work now
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@434 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-20 21:19:48 +00:00
mheily
40a4be4710 effort to fix Solaris timers
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@433 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-20 21:17:42 +00:00
mheily
51bff95606 Fix EVFILT_SIGNAL on Solaris
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@432 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-20 04:49:12 +00:00
mheily
0ee9ff97d9 Bug fixes for Solaris
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@431 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-20 03:26:04 +00:00
mheily
6bcead7f6b Add extra debug output
git-svn-id: svn://svn.code.sf.net/p/libkqueue/code/trunk@430 fb4e3144-bc1c-4b72-a658-5bcd248dd7f7
2011-02-20 03:25:22 +00:00