lisp/c/mthread_posix.c
void
suspend_init_routine (void)
{
    int status;
    struct sigaction sigusr1, sigusr2;

    /*
     * Allocate the suspended threads array. This array is used
     * to guarentee idempotency
     */
    //susp_bottom = 10;
//    susp_array = (pthread_t*) calloc (susp_bottom, sizeof (pthread_t));

    /*
     * Install the signal handlers for suspend/resume.
     */
    sigusr1.sa_flags = 0;
    sigusr1.sa_handler = suspend_signal_handler;

    sigemptyset (&sigusr1.sa_mask);
    sigusr2.sa_flags = 0;
    sigusr2.sa_handler = resume_signal_handler;
    sigusr2.sa_mask = sigusr1.sa_mask;

    status = sigaction (SIGUSR1, &sigusr1, NULL);
    if (status == -1)
      {fprintf (stderr, "Installing suspend handler: %s\n", strerror(errno)); abort();}
    
    status = sigaction (SIGUSR2, &sigusr2, NULL);
    if (status == -1)
      {fprintf (stderr, "Installing resume handler : %s\n", strerror(errno)); abort(); }
    
    susp_inited = 1;
    return;
}
/*
 * Dynamically initialize the "suspend package" when first used
 * (called by pthread_once).
 */
Dynamically initialize the "suspend package" when first used
(called by pthread_once).
Dynamically initialize the " suspend package " when first used ( called by pthread_once ) .
void
suspend_init_routine (void)
{
    int status;
    struct sigaction sigusr1, sigusr2;
    sigusr1.sa_flags = 0;
    sigusr1.sa_handler = suspend_signal_handler;
    sigemptyset (&sigusr1.sa_mask);
    sigusr2.sa_flags = 0;
    sigusr2.sa_handler = resume_signal_handler;
    sigusr2.sa_mask = sigusr1.sa_mask;
    status = sigaction (SIGUSR1, &sigusr1, NULL);
    if (status == -1)
      {fprintf (stderr, "Installing suspend handler: %s\n", strerror(errno)); abort();}
    status = sigaction (SIGUSR2, &sigusr2, NULL);
    if (status == -1)
      {fprintf (stderr, "Installing resume handler : %s\n", strerror(errno)); abort(); }
    susp_inited = 1;
    return;
}
void suspend_init_routine ( void ) { int status ; struct sigaction sigusr1 , sigusr2 ; sigusr1 . sa_flags = 0 ; sigusr1 . sa_handler = suspend_signal_handler ; sigemptyset ( & sigusr1 . sa_mask ) ; sigusr2 . sa_flags = 0 ; sigusr2 . sa_handler = resume_signal_handler ; sigusr2 . sa_mask = sigusr1 . sa_mask ; status = sigaction ( SIGUSR1 , & sigusr1 , NULL ) ; if ( status == -1 ) { fprintf ( stderr , " \n " , strerror ( errno ) ) ; abort ( ) ; } status = sigaction ( SIGUSR2 , & sigusr2 , NULL ) ; if ( status == -1 ) { fprintf ( stderr , " \n " , strerror ( errno ) ) ; abort ( ) ; } susp_inited = 1 ; return ; }
Dynamically initialize the "suspend package" when first used
 (called by pthread_once).
Dynamically initialize the " suspend package " when first used ( called by pthread_once ) .
/*
     * Allocate the suspended threads array. This array is used
     * to guarentee idempotency
     */ //susp_bottom = 10; //    susp_array = (pthread_t*) calloc (susp_bottom, sizeof (pthread_t)); /*
     * Install the signal handlers for suspend/resume.
     */