2010-04-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Fri, 23 Apr 2010 16:37:47 +0000 (16:37 -0000)
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>
Fri, 23 Apr 2010 16:37:47 +0000 (16:37 -0000)
* threadpool.c: patch from Robert Nagy that fixes a nullref and
uses mono_sem_wait instead of mono_sem_timedwait for openbsd.

svn path=/trunk/mono/; revision=156012

mono/metadata/ChangeLog
mono/metadata/threadpool.c

index 2c4a193a3baf23b3612b627ad01856dbfdb87d36..e30fbf25672339335daa369b471593eb7181dbcf 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-23 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+       * threadpool.c: patch from Robert Nagy that fixes a nullref and
+       uses mono_sem_wait instead of mono_sem_timedwait for openbsd.
+
 2010-04-20 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * icall.c (ves_icall_type_is_assignable_from): Properly handle byref
index 3dcb3159ec3dfeae5cd3504c6210e2a84d96bd76..fde7641dffb0b181fe94765bb5b874c2e24488d4 100644 (file)
@@ -460,7 +460,8 @@ socket_io_poll_main (gpointer p)
 
                        for (i = 1; i < allocated; i++) {
                                pfd = &pfds [i];
-                               if (pfd->fd == -1 || pfd->fd == data->newpfd->fd)
+                               if (pfd->fd == -1 || data->newpfd == NULL ||
+                                       pfd->fd == data->newpfd->fd)
                                        break;
                        }
 
@@ -1823,8 +1824,11 @@ async_invoke_thread (gpointer data)
 
                        TP_DEBUG ("Waiting");
                        InterlockedIncrement (&tp->waiting);
-                       //while ((res = mono_sem_wait (&tp->new_job, TRUE)) == -1) {// && errno == EINTR) {
+#if defined(__OpenBSD__)
+                       while ((res = mono_sem_wait (&tp->new_job, TRUE)) == -1) {// && errno == EINTR) {
+#else
                        while ((res = mono_sem_timedwait (&tp->new_job, 2000, TRUE)) == -1) {// && errno == EINTR) {
+#endif
                                if (mono_runtime_is_shutting_down ())
                                        break;
                                if (THREAD_WANTS_A_BREAK (thread))