This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: sigwait not returning
- From: "N.Suresh" <nsuresh at cdotb dot ernet dot in>
- To: "N.Suresh" <nsuresh at cdotb dot ernet dot in>
- Cc: Nick Garnett <nickg at ecoscentric dot com>, ecos-discuss<ecos-discuss at sources dot redhat dot com>, Prakash R <rprakash at cdotb dot ernet dot in>, Shiv Kumar <bshiva at cdotb dot ernet dot in>, Titty Thomas <titty at cdotb dot ernet dot in>
- Date: Thu, 30 Jan 2003 22:53:59 +0530
- Subject: Re: [ECOS] sigwait not returning
- Organization: C-DoT
- References: <3E380BCE.9010201@cdotb.ernet.in> <m34r7r94jj.fsf@balti.calivar.com> <3E38CA39.6040804@cdotb.ernet.in>
Hi,
We tried delivering the signal to a sigwait () call:
*) Using alarm () function --- Working.
*) pthread_kill () function --- Working.
It looks like only in the case of timer_create () case, the sigwait
is not returning.
We traced the call and found that in the following piece of code,
signal_sigwait condition variable's queue is empty.
So it is not calling the broadcast method which will wake the
sigwait thread.
It is releasing the thread, and in next POSIX_ASR call, the
cyg_deliver_signals function is calling _exit because there
is no signal handler registered for this thread.
All these functions are getting called only if i unmask the signal
in the thread before calling the sigwait.
Otherwise the check in the alarm_action function whether thread is
accepting this signal will fail.
Are we on the right path of debugging?
regards
<cut signal.cxx>
sigaddset( &sig_pending, signo );
// Wake up any threads in sigsuspend() and sigwait().
if (!signal_sigwait.get_queue()->empty())
{
signal_sigwait.broadcast();
}
else
{
cyg_posix_pthread_release_thread( &sig_pending );
}
</cut signal.cxx>
N.Suresh wrote:
Try this instead:
pthread_sigmask (SIG_BLOCK, &set, (sigset_t*)NULL);
I had tried this before. It didn't work.
So i tried to unblock all the signals in the thread itself.
If i don't do this, in alarm_action () function, the check whether any
thread is waiting for the signal is failing and
it is simply returning.
regards
--
!============================================================================!
= Suresh N., Research Engineer, C-DoT, Bangalore. =
= Call me at : OFF: 2383951(Dir) / 2263399 (268) RES: 3334248 =
= Alternate email : nsur_mys@rediffmail.com =
= QOT: Modern man is the missing link between apes and human beings.
!============================================================================!
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss