[ECOS] Wake select() with a signal

Roland Caßebohm roland.cassebohm@visionsystems.de
Mon Nov 4 09:53:00 GMT 2002


On Friday, 1. November 2002 18:04, Roland Caßebohm wrote:
> Hi everyone,
>
> I want to wake a waiting select by sending a signal to the thread.
>
> This does not always work. I think the reason is that the thread in which
> select() is call is not really sleeping all the time, even though it
> doesn't return. The pthread_kill() function respectively
> Cyg_Thread::release() only wakes a thread if the thread is sleeping. That
> makes sense, but what can I do if I want a waiting select() to return
> triggered from another thread?
>

I just changed the select() function that it looks for the asr_pending flag before it goes to sleep. I don't really think, that this is the right solution, but in my case it works.
Now the select() always returns with errno=EINTR if the thread receives a signal.

Does anybody know if the select() systemcall or every other systemcall should always return if the thread receives a signal?

Roland

-------------- next part --------------
A non-text attachment was scrubbed...
Name: select.cxx.diff
Type: text/x-diff
Size: 884 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/ecos-discuss/attachments/20021104/1b6f5384/attachment.bin>
-------------- next part --------------
-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


More information about the Ecos-discuss mailing list