summaryrefslogtreecommitdiff
path: root/select.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix all warnings in the main codebase flagged by -Wsigned-compareNick Mathewson2010-09-231-3/+6
| | | | | | | | | | | | | | | | | | Remember, the code int is_less_than(int a, unsigned b) { return a < b; } is buggy, since the C integer promotion rules basically turn it into int is_less_than(int a, unsigned b) { return ((unsigned)a) < b; } and we really want something closer to int is_less_than(int a, unsigned b) { return a < 0 || ((unsigned)a) < b; } . Suggested by an example from Ralph Castain
* Remove the now-useless evsig_caught and evsig_processNick Mathewson2010-09-151-3/+0
|
* Move event-config.h to include/event2Nick Mathewson2010-08-061-1/+1
| | | | | This change means that all required include files are in event2, and all files not in event2/* are optional.
* Remove some dead assignmentsNick Mathewson2010-05-181-5/+0
|
* more whitespace normalizationNick Mathewson2010-03-051-3/+3
|
* Update all our copyright notices to say "2010"Nick Mathewson2010-03-041-1/+1
|
* Clean up formatting: use tabs, not 8-spaces, to indent.Nick Mathewson2010-02-181-1/+1
|
* Stop passing EVTHREAD_READ and EVTHREAD_WRITE to non-rw locks.Nick Mathewson2009-11-271-2/+2
| | | | | | | | | | | | | Previously, our default lock model kind of assumed that every lock was potentially a read-write lock. This was a poor choice, since read-write locks are far more expensive than regular locks, and so the lock API should only use them when we can actually take advantage of them. Neither our pthreads or win32 lock implementation provided rw locks. Now that we have a way (not currently used!) to indicate that we really want a read-write lock, we shouldn't actually say "lock this for reading" or "lock this for writing" unless we mean it.
* We do not work any more without an event-config.h; stop pretending that it ↵Nick Mathewson2009-11-061-2/+0
| | | | | | is meaningful to check for HAVE_CONFIG_H svn:r1516
* Remove compat/sys/_time.hNick Mathewson2009-11-031-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've gone through everything that it declared to see where it was used, and it seems that we probably don't need it anywhere. Here's what it declared, and why I think we're okay dropping it. o struct timeval {} (Used all over, and we can't really get away with declaring it ourselves; we need the same definition the system uses. If we can't find struct timeval, we're pretty much sunk.) o struct timespec {} (Used in event.c, evdns.c, kqueue.c, evport.c. Of these, kqueue.c and event.c include sys/_time.h. event.c conditions its use on _EVENT_HAVE_CLOCK_GETTIME, and kqueue() only works if timespec is defined.) o TIMEVAL_TO_TIMESPEC (Used in kqueue.c, but every place with kqueue has sys/time.h) o struct timezone {} (event2/util.h has a forward declaration; only evutil.c references it and doesn't look at its contents.) o timerclear, timerisset, timercmp, timeradd, timersub (Everything now uses the evutil_timer* variants.) o ITIMER_REAL, ITIMER_VIRTUAL, ITIMER_PROF, struct itemerval (These are only used in test/regress.c, which does not include _time.h) o CLOCK_REALTIME (Only used in evdns.c, which does not include _time.h) o TIMESPEC_TO_TIMEVAL o DST_* o timespecclear, timespecisset, timespeccmp, timespecadd, timespecsub o struct clockinfo {} o CLOCK_VIRTUAL, CLOCK_PROF o TIMER_RELTIME, TIMER_ABSTIME (unused) svn:r1494
* Actually use the logic in select.c designed to make the out_sets threadsafe.Nick Mathewson2009-10-291-8/+1
| | | | svn:r1475
* Use EVUTIL_ASSERT() consistently instead of assert.Nick Mathewson2009-10-261-3/+2
| | | | svn:r1464
* Add locking to event_base_loop.Nick Mathewson2009-10-211-5/+27
| | | | | | | | | | | | | | | | This is harder than it sounds, since we need to make sure to release the lock around the key call to the kernel (e.g., select, epoll_wait, kevent), AND we need to make sure that none of the fields that are used in that call are touched by anything that might be running concurrently in another thread. I managed to do this pretty well for everything but poll(). With poll, I needed to introduce a copy of the event_set structure. This patch also fixes a bug in win32.c where we called realloc() instead of mm_realloc(). svn:r1450
* Forward-port: fix android compilationNick Mathewson2009-09-231-0/+7
| | | | svn:r1435
* Activate fd events in a pseudorandom order on older backends.Nick Mathewson2009-05-271-2/+5
| | | | | | | | | | New backends like poll and kqueue and so on add fds to the queue in the order that they are triggered. But the select backend currently activates low-numbered fds first, whereas the poll and win32 backends currently favor whatever fds have been on for the longest. This is no good for fairness. svn:r1318
* Update copyright statements to reflect the facts that:Nick Mathewson2009-01-271-2/+2
| | | | | | | | | a) this is 2009 b) niels and nick have been comaintainers for a while c) saying "all rights reserved" when you then go on to explicitly disclaim some rights is sheer cargo-cultism. svn:r1065
* Replace all use of config.h with event-config.h.Nick Mathewson2009-01-271-3/+3
| | | | svn:r1064
* Move per-fd info from eventops into evmap. Not done for win32.c yet.Nick Mathewson2009-01-141-4/+7
| | | | svn:r1008
* Rename four internal headers to follow the -internal.h convention.Nick Mathewson2009-01-131-3/+3
| | | | svn:r1000
* deprecate the usage of signal_{add,del,set} and name it ↵Niels Provos2008-12-231-5/+5
| | | | | | evsignal_{add,del,set} instead; move the old definitions to compat svn:r973
* Restructure the event backends so that they do not need to keep track of ↵Niels Provos2008-12-231-92/+35
| | | | | | events themselves, as a side effect multiple events can use the same fd or signal. svn:r972
* Add new functions to access backends by their features and to query the ↵Nick Mathewson2008-05-311-1/+2
| | | | | | features of a backend. svn:r842
* simplify handling of environment variables for disabling backends;Niels Provos2008-05-291-4/+0
| | | | | | | | make event_get_supported_methods obey environment variables; this fixes make verify; problem reported by Scott Lamb. svn:r838
* r15316@tombo: nickm | 2008-04-24 20:58:36 -0400Nick Mathewson2008-04-251-14/+14
| | | | | | | Rename internal memory management functions from event_malloc() etc to mm_malloc() etc. svn:r725
* r15193@tombo: nickm | 2008-04-16 16:00:35 -0400Nick Mathewson2008-04-161-1/+2
| | | | | | | Split event.h into several new headers in include/event2. event.h is now just a wrapper that includes all the subheaders. svn:r711
* make event methods static so that they are not exported; from Andrei NigmatulinNiels Provos2008-03-291-10/+10
| | | | svn:r692
* remove obsoleted recalc codeNiels Provos2007-12-091-17/+0
| | | | svn:r581
* move EV_PERSIST handling out of the event backendsNiels Provos2007-11-271-4/+0
| | | | svn:r555
* r16733@catbus: nickm | 2007-11-26 14:18:25 -0500Nick Mathewson2007-11-261-1/+2
| | | | | | | Add an --enable-gcc-warnings option (lifted from Tor) to the configure script. When provided, and when we are using GCC, we enable a bunch of extra GCC warnings in the compiler. Also, make the code all build happily with these warnings. svn:r553
* r14939@tombo: nickm | 2007-11-25 11:59:26 -0500Nick Mathewson2007-11-251-14/+14
| | | | | | | New function event_set_mem_functions to replace internal calls to malloc, free, etc with a user-supplied functions. svn:r541
* remove last vestiges of RBTREENiels Provos2007-11-031-1/+0
| | | | svn:r470
* check for sys/select.hNiels Provos2007-07-311-0/+3
| | | | svn:r377
* more the signal base into the event base; this removes global state and ↵Niels Provos2007-03-101-11/+11
| | | | | | | | | | makes signals work better with threading; from Wouter Wijngaards small fixes for kqueue and style by me svn:r351
* rolling back r339: evconfig.h does not workNiels Provos2007-03-011-1/+1
| | | | svn:r341
* signal fixes from scott lambNiels Provos2007-02-281-11/+5
| | | | svn:r340
* make evconfig.h available as installed header file; notNiels Provos2007-02-281-1/+1
| | | | | | | really ideal but good enough for me; from Nick Mathewson svn:r339
* introduce a way to free the base from Nick Mathewson <nickm@freehaven.net>Niels Provos2006-03-281-1/+25
| | | | svn:r210
* some nit-picking from poul-henning kampNiels Provos2006-03-281-1/+1
| | | | svn:r208
* some fixes from openbsd via bradNiels Provos2006-03-281-1/+1
| | | | svn:r207
* performance improvements of select handler by Nick Mathewson; I addedNiels Provos2005-05-111-69/+178
| | | | | | | | better recovery when memory allocation fails; something that needs to be done for the poll improvements, too. svn:r166
* make it compile on solarisNiels Provos2005-04-041-1/+0
| | | | svn:r142
* debugging callbacks from Nick Mathewson <nickm@freehaven.net>Niels Provos2005-03-291-11/+5
| | | | svn:r136
* fixes for threaded operations from Andrew DanforthNiels Provos2005-01-031-4/+7
| | | | svn:r129
* make libevent thread-safe; first cutNiels Provos2004-11-251-9/+9
| | | | svn:r122
* fix a bug for persistent events when using select()Niels Provos2004-07-131-0/+2
| | | | svn:r108
* minor corrections; change license to 3-clause BSD licenseNiels Provos2003-10-041-4/+1
| | | | svn:r84
* constify; some windows stuff by mike davis; fix a poll bugNiels Provos2003-09-251-1/+1
| | | | svn:r77
* fix signal usageNiels Provos2003-03-081-8/+2
| | | | svn:r45
* fix signal usageNiels Provos2003-03-071-5/+3
| | | | svn:r41
* replace references to __FUNCTION__ with __func__Niels Provos2003-03-011-2/+1
| | | | svn:r40