Hi Bruno, Le dimanche 12 octobre 2008 à 00:16 +0200, Bruno Haible a écrit : > You wrote on 2008-09-18 > <http://lists.gnu.org/archive/html/bug-gnulib/2008-09/msg00194.html> > and 2008-10-02 > <http://lists.gnu.org/archive/html/bug-gnulib/2008-10/msg00027.html>: > > > provide a working implementation of gl_cond_t for WIN32 platform > > (based on http://www.cs.wustl.edu/~schmidt/win32-cv-1.html). > > Thanks a lot for this. Took me a long time, but I'm now committing a modified > version of your implementation. At first, I had overlooked your mail and tried > to produce an implementation by myself. But it did not pass the test_timedcond > test. Gladly I then took your implementation, because it passed all tests :-)
Attached is a patch that fixes some compilation problem due to the latest cond and select changes. Additionally, it seems the cond timedwait test are now failing under WIN32, although I did not attempt to trace the problem yet. -- Yoann Vandoorselaere | Responsable R&D / CTO | PreludeIDS Technologies Tel: +33 (0)9 50 70 21 58 Fax: +33(0)9 57 25 21 58 http://www.prelude-ids.com
diff --git a/lib/glthread/cond.c b/lib/glthread/cond.c index c35272e..087369f 100644 --- a/lib/glthread/cond.c +++ b/lib/glthread/cond.c @@ -102,6 +102,8 @@ glthread_cond_init_func (gl_cond_t *cond) int glthread_cond_wait_func (gl_cond_t *cond, gl_lock_t *lock) { + int ret; + if (!cond->guard.done) { if (InterlockedIncrement (&cond->guard.started) == 0) @@ -189,6 +191,7 @@ glthread_cond_wait_func (gl_cond_t *cond, gl_lock_t *lock) int glthread_cond_timedwait_func (gl_cond_t *cond, gl_lock_t *lock, struct timespec *abstime) { + int ret; struct timeval currtime; gettimeofday (&currtime, NULL); diff --git a/tests/test-poll.c b/tests/test-poll.c index 3b4ab35..64dec2c 100644 --- a/tests/test-poll.c +++ b/tests/test-poll.c @@ -22,6 +22,7 @@ #include <stdio.h> #include <string.h> #include <sys/socket.h> +#include <sys/ioctl.h> #include <netinet/in.h> #include <arpa/inet.h> #include <poll.h> diff --git a/tests/test-select.c b/tests/test-select.c index 50f7559..6de3d0d 100644 --- a/tests/test-select.c +++ b/tests/test-select.c @@ -24,6 +24,7 @@ #include <string.h> #include <netinet/in.h> #include <arpa/inet.h> +#include <sys/ioctl.h> #include <fcntl.h> #include <stdlib.h> #include <stdbool.h>