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]

select() and signal's


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.

How can I  do it in eCos?


Thanks in advance.

--
Boris Guzhov,
St.Petersburg, Russia




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