This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: sigwait not returning


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]