Use the correct link entry for walking the list of threads.
While I'm here, use the TAILQ_FOREACH macro instead of a more manual method which was inherited from libc_r (so we could remove elements from the list which isn't needed for libpthread). Submitted by: Kazuaki Oda <kaakun@highway.ne.jp>
This commit is contained in:
parent
389061c125
commit
4d8bc81d7d
@ -258,7 +258,7 @@ struct pthread *
|
||||
thr_sig_find(struct kse *curkse, int sig, siginfo_t *info)
|
||||
{
|
||||
int handler_installed;
|
||||
struct pthread *pthread, *pthread_next;
|
||||
struct pthread *pthread;
|
||||
struct pthread *suspended_thread, *signaled_thread;
|
||||
|
||||
DBG_MSG("Looking for thread to handle signal %d\n", sig);
|
||||
@ -285,14 +285,7 @@ thr_sig_find(struct kse *curkse, int sig, siginfo_t *info)
|
||||
signaled_thread = NULL;
|
||||
|
||||
KSE_LOCK_ACQUIRE(curkse, &_thread_list_lock);
|
||||
for (pthread = TAILQ_FIRST(&_thread_list);
|
||||
pthread != NULL; pthread = pthread_next) {
|
||||
/*
|
||||
* Grab the next thread before possibly destroying
|
||||
* the link entry.
|
||||
*/
|
||||
pthread_next = TAILQ_NEXT(pthread, pqe);
|
||||
|
||||
TAILQ_FOREACH(pthread, &_thread_list, tle) {
|
||||
if ((pthread->state == PS_SIGWAIT) &&
|
||||
sigismember(pthread->data.sigwait, sig)) {
|
||||
/* Take the scheduling lock. */
|
||||
|
@ -258,7 +258,7 @@ struct pthread *
|
||||
thr_sig_find(struct kse *curkse, int sig, siginfo_t *info)
|
||||
{
|
||||
int handler_installed;
|
||||
struct pthread *pthread, *pthread_next;
|
||||
struct pthread *pthread;
|
||||
struct pthread *suspended_thread, *signaled_thread;
|
||||
|
||||
DBG_MSG("Looking for thread to handle signal %d\n", sig);
|
||||
@ -285,14 +285,7 @@ thr_sig_find(struct kse *curkse, int sig, siginfo_t *info)
|
||||
signaled_thread = NULL;
|
||||
|
||||
KSE_LOCK_ACQUIRE(curkse, &_thread_list_lock);
|
||||
for (pthread = TAILQ_FIRST(&_thread_list);
|
||||
pthread != NULL; pthread = pthread_next) {
|
||||
/*
|
||||
* Grab the next thread before possibly destroying
|
||||
* the link entry.
|
||||
*/
|
||||
pthread_next = TAILQ_NEXT(pthread, pqe);
|
||||
|
||||
TAILQ_FOREACH(pthread, &_thread_list, tle) {
|
||||
if ((pthread->state == PS_SIGWAIT) &&
|
||||
sigismember(pthread->data.sigwait, sig)) {
|
||||
/* Take the scheduling lock. */
|
||||
|
Loading…
Reference in New Issue
Block a user