Commit Graph

13 Commits

Author SHA1 Message Date
Hiroaki Nakamura
acea3028c5 unix, windows: add thread barrier support 2012-10-09 17:30:52 +02:00
Hiroaki Nakamura
976c8a4387 Add support for condition variables on all platforms 2012-10-05 13:03:55 +02:00
Bert Belder
744dc3e77c windows: make uv_rwlock_init initialize libuv
Without this patch, the fallback implementation would be used if
uv_rwlock_init were to be called before a loop was created or
uv_default_loop() was called.
2012-10-04 01:21:30 +02:00
Bert Belder
5a2988fc33 windows: remove unnecessary pointer alignment code 2012-09-14 01:48:41 +02:00
Bert Belder
c0b530d079 Windows: avoid compiler warning 2012-06-04 18:04:48 +02:00
Ben Noordhuis
c76c2066c6 unix, windows: add semaphore functions 2012-06-03 04:04:05 +02:00
Ben Noordhuis
9efa8b3571 unix, windows: rework reference counting scheme
This commit changes how the event loop determines if it needs to stay alive.

Previously, an internal counter was increased whenever a handle got created
and decreased again when the handle was closed.

While conceptually simple, it turned out hard to work with: you often want
to keep the event loop alive only if the handle is actually doing something.
Stopped or inactive handles were a frequent source of hanging event loops.

That's why this commit changes the reference counting scheme to a model where
a handle only references the event loop when it's active. 'Active' means
different things for different handle types, e.g.:

 * timers: ticking
 * sockets: reading, writing or listening
 * processes: always active (for now, subject to change)
 * idle, check, prepare: only active when started

This commit also changes how the uv_ref() and uv_unref() functions work: they
now operate on the level of individual handles, not the whole event loop.

The Windows implementation was done by Bert Belder.
2012-05-17 07:07:53 +02:00
Igor Zinkovsky
26512731e3 remove uv_thread_self 2012-01-13 17:24:30 -08:00
Igor Zinkovsky
94a5c7b002 fix warnings in windows build 2012-01-11 18:12:51 -08:00
Ben Noordhuis
0db56ea41a windows: implement uv_thread_self() 2011-12-29 01:40:49 +01:00
Ben Noordhuis
8e4ed88bbe Wrap platform thread APIs. 2011-11-21 21:04:16 +01:00
Ben Noordhuis
e4680ccc62 windows: make SRWLock API usage more explicit 2011-11-18 12:59:10 +01:00
Ben Noordhuis
1fc1f28093 Wrap platform mutex and rwlock APIs.
Read/write locks are emulated with critical sections on Windows XP and Vista
because those platforms don't have a (complete) native read/write lock API.
2011-11-18 12:42:08 +01:00