SLEEPQUEUE(9): Add wmesg to thread wait info

This commit is contained in:
Sebastian Huber 2017-01-31 09:50:45 +01:00
parent ee94f8a8ea
commit 1fd5083234
2 changed files with 5 additions and 2 deletions

View File

@ -399,12 +399,13 @@ sleepq_add(void *wchan, struct lock_object *lock, const char *wmesg, int flags,
executing = td->td_thread;
_Thread_Wait_acquire_default(executing, &lock_context);
td->td_sq_state = TD_SQ_TIRED;
executing->Wait.return_argument_second.immutable_object = wmesg;
#endif /* __rtems__ */
td->td_sleepqueue = NULL;
td->td_sqqueue = queue;
td->td_wchan = wchan;
td->td_wmesg = wmesg;
#ifndef __rtems__
td->td_wmesg = wmesg;
if (flags & SLEEPQ_INTERRUPTIBLE) {
td->td_flags |= TDF_SINTR;
td->td_flags &= ~TDF_SLEEPABORT;
@ -968,7 +969,9 @@ sleepq_resume_thread(struct sleepqueue *sq, struct thread *td, int pri)
_Thread_Wait_acquire_default_critical(thread, &lock_context);
#endif /* __rtems__ */
#ifndef __rtems__
td->td_wmesg = NULL;
#endif /* __rtems__ */
td->td_wchan = NULL;
#ifndef __rtems__
td->td_flags &= ~TDF_SINTR;

View File

@ -260,8 +260,8 @@ struct thread {
#endif /* __rtems__ */
int td_sqqueue; /* (t) Sleepqueue queue blocked on. */
void *td_wchan; /* (t) Sleep address. */
const char *td_wmesg; /* (t) Reason for sleep. */
#ifndef __rtems__
const char *td_wmesg; /* (t) Reason for sleep. */
volatile u_char td_owepreempt; /* (k*) Preempt on last critical_exit */
u_char td_tsqueue; /* (t) Turnstile queue blocked on. */
short td_locks; /* (k) Debug: count of non-spin locks */