public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Nick Garnett <nickg@ecoscentric.com>
To: "N.Suresh" <nsuresh@cdotb.ernet.in>
Cc: ecos-discuss <ecos-discuss@sources.redhat.com>,
	Shiv Kumar <bshiva@cdotb.ernet.in>,
	Prakash R <rprakash@cdotb.ernet.in>,
	Titty Thomas <titty@cdotb.ernet.in>
Subject: Re: [ECOS] sigwait not returning
Date: Wed, 29 Jan 2003 23:33:00 -0000	[thread overview]
Message-ID: <m34r7r94jj.fsf@balti.calivar.com> (raw)
In-Reply-To: <3E380BCE.9010201@cdotb.ernet.in>

"N.Suresh" <nsuresh@cdotb.ernet.in> writes:

> Hi all,
>     I am using sigwait () call to handle the signal in a thread.
>     But the call never returns.
> 
>     We have traced the call and found that the thread is exiting in
> cyg_deliver_signals function with
>     error "Unknown handler for the signal".
> 
>     I think it shouldn't enter the function at all, because the
> delivery method for
>     sigwait call is via the broadcast method for the global  condition
> variable named signal_sigwait.
>      I have attached the example code below.
>     Am i missing something?

You are. For sigwait() to work you have to block the signals you are
sigwait()ing for from normal delivery. sigwait() then unblocks the
signals it wants, but stops them from being delivered via the normal
mechanism and delivers them by returning.

> 	// Unblock all the signals
> 	sigfillset (&set);
> 	pthread_sigmask (SIG_UNBLOCK, &set, (sigset_t*)NULL);

Try this instead:

	pthread_sigmask (SIG_BLOCK, &set, (sigset_t*)NULL);

-- 
Nick Garnett - eCos Kernel Architect
http://www.eCosCentric.com/


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

  reply	other threads:[~2003-01-29 18:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-29 18:09 N.Suresh
2003-01-29 23:33 ` Nick Garnett [this message]
2003-01-30  8:44   ` N.Suresh
2003-01-30 17:46     ` N.Suresh
2003-01-31 14:29       ` Nick Garnett
2003-01-31 18:36         ` Nick Garnett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m34r7r94jj.fsf@balti.calivar.com \
    --to=nickg@ecoscentric.com \
    --cc=bshiva@cdotb.ernet.in \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=nsuresh@cdotb.ernet.in \
    --cc=rprakash@cdotb.ernet.in \
    --cc=titty@cdotb.ernet.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).