This is the mail archive of the cygwin mailing list for the Cygwin 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: PROBLEM - Signals not handled while waiting on semphores


Thanks for the quick reply, classic SysV semaphores do behave correctly with new dll.

unfortunately there are still problems -
* flag SA_RESTART passed to sigaction seem to be ignored ( see previous post for sample code )
* signals are not delivered when using POSIX named semaphores (semaphore.h)


The following code reproduces the problem with cygwin1.dll & cygserv.exe from 2004-02-21

-gabi

==========================================================
struct sigaction gintact;
sem_t *sem;
static int sem_count = 0;
char sem_name[ 64 ];


sprintf( sem_name, "/tmp/%d.%d", getpid(), sem_count++ );
sem = sem_open( sem_name, O_CREAT, O_RDWR, 0 );
if (sem == SEM_FAILED) {
perror( "Failed to create sempahore" );
return 1;
}


   if (sigemptyset( &gintact.sa_mask ) < 0) {
       perror("Failed to initialize the signal mask");
       return 1;
   }

   gintact.sa_handler = &GIntHandler;
   gintact.sa_flags = SA_RESTART;

   if (sigaction( SIGUSR1, &gintact, NULL ) < 0) {
       perror("Failed to install the handler");
       return 1;
   }

   if (sem_wait(sem) == -1) {
       perror("Failed to lock semlock");
   }
   ...
Corinna Vinschen wrote:

On Feb 23 14:17, Gabi Davar wrote:


Hi,

I'm unable to receive signals while waiting on semaphores. The following short program illustrates the problem. Sending SIGUSR1 when in semop does not result in "sig handler!!!" print.



That should be solved in CVS. Try a recent cygwin snapshot from http://cygwin.com/snapshots/ Replace both, cygwin1.dll and cygserver.exe.

Corinna




-- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/


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