* Makefile (MCS) [PROFILE=default]: Force testing of 'mcs'.
[mono.git] / mono / io-layer / timed-thread.c
index 2ae57dd5cae104f4d5b81c66d737fe7a95021ab9..6599e0660f307150c3d0359bd34fce0f7687a4b6 100644 (file)
@@ -14,6 +14,7 @@
 #ifdef HAVE_SEMAPHORE_H
 #include <semaphore.h>
 #endif
+#include <errno.h>
 
 #include <mono/io-layer/processes.h>
 
@@ -253,6 +254,8 @@ int _wapi_timed_thread_join(TimedThread *thread, struct timespec *timeout,
                if(exitstatus!=NULL) {
                        *exitstatus = thread->exitstatus;
                }
+
+               _wapi_timed_thread_destroy (thread);
        }
        return(result);
 }
@@ -295,7 +298,7 @@ void _wapi_timed_thread_suspend (TimedThread *thread)
                exit (-1);
        }
 
-       MONO_SEM_WAIT (&thread->suspend_sem);
+       while (MONO_SEM_WAIT (&thread->suspend_sem) != 0 && errno == EINTR);
 }
 
 void _wapi_timed_thread_resume (TimedThread *thread)