Nick Mathewson
4868f4d217
Initial support for a lightweight 'deferred callbacks'.
...
A 'deferred callback' is just a function that we've queued in the
event base. This ability is needed for some mt stuff, and for complex
callback chains. For internal use only.
svn:r1150
2009-04-10 14:22:33 +00:00
Nick Mathewson
e3d82497c9
Don't allow internal events to starve lower-priority events.
...
This is exceptionally important with multithreaded stuff, where we use
an event to notify the base that other events have been made active.
If the activated events have a prioirty number greater than that of the
notification event, it will starve them, and that's no good.
svn:r1149
2009-04-10 14:21:53 +00:00
Nick Mathewson
f98385a407
add a missing "static" to timeout_process.
...
svn:r1145
2009-04-08 16:57:38 +00:00
Nick Mathewson
ec35eb5520
Make threading functions global, like the mm_ functions. Use the libevent_pthread.la library in regress_pthread.
...
svn:r1121
2009-02-12 22:19:54 +00:00
Nick Mathewson
b85b710cf5
Update copyright statements to reflect the facts that:
...
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
2009-01-27 22:34:36 +00:00
Nick Mathewson
8889a77039
Replace all use of config.h with event-config.h.
...
svn:r1064
2009-01-27 22:30:46 +00:00
Nick Mathewson
9993137cbb
Remove all trailing whitespace in all the source files.
...
svn:r1063
2009-01-27 21:10:31 +00:00
Niels Provos
1c927b7d2f
fix memory leak whens etting up priorities; reported by Alexander Drozdov
...
svn:r1061
2009-01-27 16:29:48 +00:00
Nick Mathewson
f20902a290
Remove evperiodic_assign and its related parts: its functionality is subsumed by EV_PERSIST timeouts.
...
svn:r1040
2009-01-22 17:56:15 +00:00
Nick Mathewson
5e6f6dcd1b
Use EV_PERSIST on notify event for efficiency and simplicity.
...
svn:r1039
2009-01-22 17:48:55 +00:00
Niels Provos
56ea4687a5
Change the semantics of timeouts in conjunction with EV_PERSIST; timeouts in that case will now repeat until deleted.
...
svn:r1032
2009-01-22 02:33:38 +00:00
Niels Provos
ed7e0e77ed
bug fix and potentital race condition from Alexander Drozdov
...
svn:r1025
2009-01-19 23:40:11 +00:00
Nick Mathewson
a5901991c7
Use eventfd for main-thread notification where available (i.e., linux).
...
svn:r1023
2009-01-19 20:37:24 +00:00
Nick Mathewson
c3e9fcf672
Change the semantics of notify so we can implement it with eventfd or (given a different backend for win32) a windows Event.
...
svn:r1022
2009-01-19 20:22:47 +00:00
Nick Mathewson
34d2fd0634
Debug and enable pipe notification
...
svn:r1021
2009-01-19 19:46:03 +00:00
Nick Mathewson
ec4cfa33c9
Make event_break threadsafe; make notify-thread mechanism a little more generic; let it use pipes where they work.
...
svn:r1019
2009-01-19 01:34:14 +00:00
Nick Mathewson
6bb2f84216
Add initializer functions for evmap types.
...
svn:r1005
2009-01-14 18:38:03 +00:00
Nick Mathewson
169321c9e6
Rename four internal headers to follow the -internal.h convention.
...
svn:r1000
2009-01-13 20:26:37 +00:00
Nick Mathewson
55bcd7d2f0
On win32, use a hashtable to map sockets to events rather than using an array.
...
svn:r988
2009-01-09 13:42:21 +00:00
Niels Provos
d776f8462b
deprecate the usage of signal_{add,del,set} and name it evsignal_{add,del,set} instead; move the old definitions to compat
...
svn:r973
2008-12-23 22:23:37 +00:00
Niels Provos
02b2b4d1be
Restructure the event backends so that they do not need to keep track of events themselves, as a side effect multiple events can use the same fd or signal.
...
svn:r972
2008-12-23 16:37:01 +00:00
Niels Provos
77867244a9
memory leak: forgot to free the configuration object
...
svn:r961
2008-12-19 21:02:36 +00:00
Niels Provos
808f00e1a1
constify structs; from Andrei Nigmatulin
...
svn:r959
2008-12-13 06:11:12 +00:00
Niels Provos
4fa4a56253
fix a typo in setting the global event base; reported by lance
...
svn:r953
2008-11-27 19:57:48 +00:00
Niels Provos
4fe25cefb5
Clear the timer cache when leaving the event loop; reported by Robin Haberkorn
...
svn:r950
2008-11-27 19:27:33 +00:00
Niels Provos
31cfe52662
clear the timer cache on entering event loop; reported by Victor Chang
...
svn:r944
2008-10-30 19:38:31 +00:00
Nick Mathewson
c97ee898dc
Fix: do not crash when asked to configure an impossible event_base
...
svn:r942
2008-09-26 13:36:15 +00:00
Nick Mathewson
de069b9977
On win32, errno is not the last socket error. Worse, WSAGetLastError() is not the last socket error sometimes (i.e., EWOULDBLOCK). Also, strerror() does not handle winsock errors. Therefore, event_err() and event_warn() are completely wrong for windows socket errors. Fix that.
...
svn:r936
2008-09-05 16:29:56 +00:00
Niels Provos
cca2f8fa0e
make event_add not change any state if it fails; repoted by Ian Bell
...
svn:r923
2008-07-25 01:29:54 +00:00
Niels Provos
3b24f4eedc
another fix; we also need to remove the signal event from the queue
...
svn:r918
2008-07-25 00:48:30 +00:00
Niels Provos
e67a5ea9bb
fix a problem with epoll and event_reinit; reported by Alexander Drozdov
...
svn:r917
2008-07-25 00:19:15 +00:00
Niels Provos
f7e61870e9
support multiple events listening on the same signal; make signals regular events that go on the same event queue
...
svn:r901
2008-07-11 15:49:04 +00:00
Niels Provos
60e4c0674a
add an event_debug statement for executing active events.
...
svn:r865
2008-06-24 22:41:43 +00:00
Niels Provos
35b1236c84
change write to send for windows.
...
svn:r859
2008-06-24 15:29:41 +00:00
Nick Mathewson
05965921ab
Add new functions to access backends by their features and to query the features of a backend.
...
svn:r842
2008-05-31 14:37:31 +00:00
Niels Provos
2deb3ce061
simplify handling of environment variables for disabling backends;
...
make event_get_supported_methods obey environment variables; this
fixes make verify; problem reported by Scott Lamb.
svn:r838
2008-05-29 01:39:43 +00:00
Niels Provos
8b66f1bd4d
constify struct timeval *
...
svn:r836
2008-05-17 02:14:17 +00:00
Niels Provos
134344b79e
Fix use of freed memory in event_reinit; pointed out by Peter Postma
...
svn:r834
2008-05-16 01:55:40 +00:00
Nick Mathewson
a68de2525d
r19749@catbus: nickm | 2008-05-14 23:48:44 -0400
...
New function to dump inserted and active events. Also do not recv() on an int array.
svn:r829
2008-05-15 03:49:03 +00:00
Niels Provos
f9b4ee0aa4
replace write/read/close with send/recv/EVUTIL_CLOSESOCKET
...
svn:r828
2008-05-15 03:19:05 +00:00
Niels Provos
90ddd91ff0
do not include sys/time.h on windows
...
svn:r826
2008-05-15 03:14:48 +00:00
Nick Mathewson
03fafae006
Make trunk event.c build happily on win32 under mingw.
...
svn:r811
2008-05-12 01:03:36 +00:00
Nick Mathewson
8acb80b4f9
r15551@tombo: nickm | 2008-05-08 14:49:20 -0400
...
Use _get_ convention for new accessor functions. (These are all new ones as of 2.0, I believe).
svn:r799
2008-05-08 22:51:39 +00:00
Nick Mathewson
3d60bccc8e
r19656@catbus: nickm | 2008-05-08 10:25:08 -0400
...
forward-port: Remove #include "misc.h"s.
svn:r795
2008-05-08 14:25:44 +00:00
Nick Mathewson
a26442c5ac
r19649@catbus: nickm | 2008-05-08 10:00:14 -0400
...
Replace gettimeofday() usage with a new evutil_gettimeofday(). This removes all previous need for win32-code/misc.[ch]
svn:r792
2008-05-08 14:06:33 +00:00
Niels Provos
3f56e364b7
event_base_new_with_config() and related methods
...
svn:r789
2008-05-08 05:56:20 +00:00
Niels Provos
3b2022ef3a
provide an api for retrieving the supported event mechanisms
...
svn:r788
2008-05-08 05:33:15 +00:00
Nick Mathewson
d0c3644e63
r19599@catbus: nickm | 2008-05-05 11:26:18 -0400
...
Turn event_initialized() and friends into a function; add function equivalents for EVENT_FD and EVENT_SIGNAL.
svn:r773
2008-05-05 15:45:30 +00:00
Nick Mathewson
40a44b36bb
r19564@catbus: nickm | 2008-05-04 13:23:10 -0400
...
Fix compile with --enable-gcc-warnings and clock_gettime()
svn:r766
2008-05-04 17:23:20 +00:00
Niels Provos
181007b9cf
make event_assign void; it cannot return an error
...
svn:r763
2008-05-03 22:14:44 +00:00