Pending signals
Pending signals
- Subject: Pending signals
- From: Jean-Luc Béchennec <email@hidden>
- Date: Thu, 9 Jun 2005 14:09:39 +0200
Hi all,
I am working on an open source implementation of OSEK-VDX and I
decided to be able to run an OSEK app in a process on my Mac (the OSEK
OS run on a virtual machine which is a Unix process).
I use signals to emulate hardware interrupts. Currently I am blocking
signal when I enter an OSEK OS call and I unblock them when I leave.
The reading of sigaction man page leaves me the impression the blocked
signals are memorized and delivered when unblocked but it does not
seems to work properly.
The function that blocks the signals is the following one (lock is
unused, signal_set is a global inited at start with the signal that are
enables) :
void tpl_get_lock(tpl_lock *lock)
{
/*
* block the handling of signals
*/
if (sigprocmask(SIG_BLOCK,&signal_set,NULL) == -1) {
perror("tpl_get_lock failed");
exit(-1);
}
}
The function that unblock was the following one
void tpl_release_lock(tpl_lock *lock)
{
/*
* unblock the handling of signals
*/
if (sigprocmask(SIG_UNBLOCK,&signal_set,NULL) == -1) {
perror("tpl_release_lock failed");
exit(-1);
}
}
and the signal was never delivered
I modified tpl_release_lock to look at pending signals :
void tpl_release_lock(tpl_lock *lock)
{
sigset_t pending_sigs;
sigemptyset(&pending_sigs);
if (sigpending(&pending_sigs) < 0) {
perror("tpl_release_lock failed");
exit(-1);
}
if (pending_sigs != 0) {
printf("There is one pending\n");
}
/*
* unblock the handling of signals
*/
if (sigprocmask(SIG_UNBLOCK,&signal_set,NULL) == -1) {
perror("tpl_release_lock failed");
exit(-1);
}
}
with no success, pending_sigs is always 0
Could somebody hilight me about my problem ?
Best regards
--
Jean-Luc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden