mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-09 20:41:27 -04:00
nick found a race condition in the pthreads test case
svn:r1554
This commit is contained in:
parent
b8f222e055
commit
986500de4d
@ -52,6 +52,7 @@ Changes in 2.0.3-alpha:
|
|||||||
o Finally expose the IOCP-based bufferevent backend. It passes its unit tests, but probably still has some bugs remaining. Code by Nick Mathewson and Christopher Davis.
|
o Finally expose the IOCP-based bufferevent backend. It passes its unit tests, but probably still has some bugs remaining. Code by Nick Mathewson and Christopher Davis.
|
||||||
o Numerous other bugfixes.
|
o Numerous other bugfixes.
|
||||||
o On FreeBSD and other OSes, connect can return ECONREFUSED immediately; instead of failing the function call, pretend with faileld in the callback.
|
o On FreeBSD and other OSes, connect can return ECONREFUSED immediately; instead of failing the function call, pretend with faileld in the callback.
|
||||||
|
o Fix a race condition in the pthreads test case; found by Nick Mathewson
|
||||||
|
|
||||||
Changes in 2.0.2-alpha:
|
Changes in 2.0.2-alpha:
|
||||||
o Add a new flag to bufferevents to make all callbacks automatically deferred.
|
o Add a new flag to bufferevents to make all callbacks automatically deferred.
|
||||||
|
@ -73,9 +73,11 @@ basic_thread(void *arg)
|
|||||||
for (i = 0; i < 100; i++) {
|
for (i = 0; i < 100; i++) {
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
evutil_timerclear(&tv);
|
evutil_timerclear(&tv);
|
||||||
assert(evtimer_add(&ev, &tv) == 0);
|
|
||||||
|
|
||||||
assert(pthread_mutex_lock(&cw.lock) == 0);
|
assert(pthread_mutex_lock(&cw.lock) == 0);
|
||||||
|
/* we need to make sure that even does not happen before
|
||||||
|
* we get to wait on the conditional variable */
|
||||||
|
assert(evtimer_add(&ev, &tv) == 0);
|
||||||
assert(pthread_cond_wait(&cw.cond, &cw.lock) == 0);
|
assert(pthread_cond_wait(&cw.cond, &cw.lock) == 0);
|
||||||
assert(pthread_mutex_unlock(&cw.lock) == 0);
|
assert(pthread_mutex_unlock(&cw.lock) == 0);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user