Bugzilla bug #43507: install the SIGALRM signal handler in

_MD_EnableClockInterrupts before starting the interval timer.
Modified files: _unixos.h, unix.c
This commit is contained in:
wtc%netscape.com 2000-06-28 02:49:24 +00:00
Родитель 6439c2e6de
Коммит 53265d09a5
2 изменённых файлов: 18 добавлений и 15 удалений

Просмотреть файл

@ -252,6 +252,9 @@ extern PRStatus _MD_KillUnixProcess(struct PRProcess *process);
/************************************************************************/
extern void _MD_EnableClockInterrupts(void);
extern void _MD_DisableClockInterrupts(void);
#define _MD_START_INTERRUPTS _MD_StartInterrupts
#define _MD_STOP_INTERRUPTS _MD_StopInterrupts
#define _MD_DISABLE_CLOCK_INTERRUPTS _MD_DisableClockInterrupts

Просмотреть файл

@ -2088,21 +2088,6 @@ static void HPUX9_ClockInterruptHandler(
void _MD_StartInterrupts()
{
char *eval;
#ifdef HPUX9
struct sigvec vec;
vec.sv_handler = (void (*)()) HPUX9_ClockInterruptHandler;
vec.sv_mask = 0;
vec.sv_flags = 0;
sigvector(SIGALRM, &vec, 0);
#else
struct sigaction vtact;
vtact.sa_handler = (void (*)()) ClockInterruptHandler;
sigemptyset(&vtact.sa_mask);
vtact.sa_flags = SA_RESTART;
sigaction(SIGALRM, &vtact, 0);
#endif /* HPUX9 */
if ((eval = getenv("NSPR_NOCLOCK")) != NULL) {
if (atoi(eval) == 0)
@ -2127,6 +2112,21 @@ void _MD_EnableClockInterrupts()
{
struct itimerval itval;
extern PRUintn _pr_numCPU;
#ifdef HPUX9
struct sigvec vec;
vec.sv_handler = (void (*)()) HPUX9_ClockInterruptHandler;
vec.sv_mask = 0;
vec.sv_flags = 0;
sigvector(SIGALRM, &vec, 0);
#else
struct sigaction vtact;
vtact.sa_handler = (void (*)()) ClockInterruptHandler;
sigemptyset(&vtact.sa_mask);
vtact.sa_flags = SA_RESTART;
sigaction(SIGALRM, &vtact, 0);
#endif /* HPUX9 */
PR_ASSERT(_pr_numCPU == 1);
itval.it_interval.tv_sec = 0;