From: Jonathan Larmour <jlarmour@redhat.com>
To: "Boris V. Guzhov" <borg@int.spb.ru>
Cc: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] select() and signal's
Date: Fri, 20 Apr 2001 06:57:00 -0000 [thread overview]
Message-ID: <3AE0404E.B3BE865C@redhat.com> (raw)
In-Reply-To: <01b701c0c996$c29891f0$7601a8c0@borg>
"Boris V. Guzhov" wrote:
>
> Hi,
>
> Are there any way in eCos to interrupt the select() blocking
> through a sending of a any signal?
>
> For instance:
>
> // posix thread 1:
> void *thr1(void *par)
> {
> struct sigaction sa;
> sigset_t mask;
>
> sigemptyset( &mask );
> sigaddset( &mask, SIGRTMIN );
> pthread_sigmask( SIG_UNBLOCK, &mask, 0 );
>
> sigemptyset( &sa.sa_mask );
> sa.sa_flags = SA_SIGINFO;
> sa.sa_sigaction = my_sig_handler;
> sigaction( SIGTRTMIN, &sa, NULL);
>
> fd_set rfds;
> int retval;
>
> FD_ZERO(&rfds);
> FD_SET(0, &rfds);
> retval = select(1, &rfds, NULL, NULL, NULL);
> if ( retval < 0 )
> perror("select:");
> ...
> }
>
> // posix thread 2:
> void *thr2(void *par)
> {
> ...
> pthread_kill( th1, SIGRTMIN) ;
> ...
> }
>
> In Linux it works, but in eCos it not works.
It is meant to work in eCos. It's meant to return -1 and set errno to
EINTR. Are you sure thr1 isn't being pre-empted for any other reason, e.g.
if thr2 is higher priority.
Try setting a breakpoint on the function cyg_sigqueue and debugging it.
jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
next prev parent reply other threads:[~2001-04-20 6:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-04-20 5:42 Boris V. Guzhov
2001-04-20 6:57 ` Jonathan Larmour [this message]
2001-04-20 8:13 ` Boris V. Guzhov
2001-04-20 13:11 ` Jonathan Larmour
2001-04-21 5:52 ` Boris V. Guzhov
2001-04-21 6:02 ` Boris V. Guzhov
2001-04-23 12:32 ` Jonathan Larmour
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=3AE0404E.B3BE865C@redhat.com \
--to=jlarmour@redhat.com \
--cc=borg@int.spb.ru \
--cc=ecos-discuss@sourceware.cygnus.com \
/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).