* src/threads/posix/thread-posix.c: Likewise.
* src/threads/posix/lock.c: Likewise.
--HG--
extra : transplant_source : %A33%F7%92%CA%07%C3%96%DC%3F%80%15%BC%BE%D7%1A%D5%98%DA%D8
mutex_lock(&(waitingthread->waitmutex));
mutex_lock(&(waitingthread->waitmutex));
- DEBUGLOCKS(("[lock_record_notify: lr=%p, t=%p, waitingthread=%p, sleeping=%d, one=%d]",
- lr, t, waitingthread, waitingthread->sleeping, one));
+ DEBUGLOCKS(("[lock_record_notify: lr=%p, t=%p, waitingthread=%p, one=%d]",
+ lr, t, waitingthread, one));
- /* Signal the thread if it's sleeping. sleeping can be false
- when the waiting thread is blocked between giving up the
- monitor and entering the waitmutex. It will eventually
- observe that it's signaled and refrain from going to
- sleep. */
-
- if (waitingthread->sleeping)
- pthread_cond_signal(&(waitingthread->waitcond));
+ pthread_cond_signal(&(waitingthread->waitcond));
/* Mark the thread as signaled. */
/* Mark the thread as signaled. */
t->interrupted = false;
t->signaled = false;
t->interrupted = false;
t->signaled = false;
t->suspended = false;
t->suspend_reason = 0;
t->suspended = false;
t->suspend_reason = 0;
mutex_lock(&t->waitmutex);
mutex_lock(&t->waitmutex);
- /* mark us as sleeping */
-
- t->sleeping = true;
-
/* wait on waitcond */
if (wakeupTime->tv_sec || wakeupTime->tv_nsec) {
/* wait on waitcond */
if (wakeupTime->tv_sec || wakeupTime->tv_nsec) {
/* release the waitmutex */
mutex_unlock(&t->waitmutex);
/* release the waitmutex */
mutex_unlock(&t->waitmutex);
pthread_kill(thread->tid, SIGHUP);
pthread_kill(thread->tid, SIGHUP);
- if (thread->sleeping)
- pthread_cond_signal(&thread->waitcond);
+ pthread_cond_signal(&thread->waitcond);
thread->interrupted = true;
thread->interrupted = true;
bool interrupted;
bool signaled;
bool interrupted;
bool signaled;
bool suspended; /* is this thread suspended? */
s4 suspend_reason; /* reason for suspending */
bool suspended; /* is this thread suspended? */
s4 suspend_reason; /* reason for suspending */