Merged to new trunk.
[cacao.git] / src / threads / posix / thread-posix.c
index 26002bc5b25101bebe986732689d07d85e00b152..cfa6deca7de49c11052d1257b6355caed1796132 100644 (file)
@@ -723,7 +723,6 @@ void threads_impl_thread_clear(threadobject *t)
 
        t->interrupted = false;
        t->signaled = false;
-       t->sleeping = false;
 
        t->suspended = false;
        t->suspend_reason = 0;
@@ -1648,10 +1647,6 @@ static void threads_wait_with_timeout(threadobject *t, struct timespec *wakeupTi
 
        mutex_lock(&t->waitmutex);
 
-       /* mark us as sleeping */
-
-       t->sleeping = true;
-
        /* wait on waitcond */
 
        if (wakeupTime->tv_sec || wakeupTime->tv_nsec) {
@@ -1678,8 +1673,6 @@ static void threads_wait_with_timeout(threadobject *t, struct timespec *wakeupTi
                }
        }
 
-       t->sleeping    = false;
-
        /* release the waitmutex */
 
        mutex_unlock(&t->waitmutex);
@@ -1770,8 +1763,7 @@ void threads_thread_interrupt(threadobject *thread)
 
        pthread_kill(thread->tid, SIGHUP);
 
-       if (thread->sleeping)
-               pthread_cond_signal(&thread->waitcond);
+       pthread_cond_signal(&thread->waitcond);
 
        thread->interrupted = true;