Diff for /rpl/src/interruptions.c between versions 1.179 and 1.180

version 1.179, 2016/04/06 21:14:56 version 1.180, 2016/07/20 16:23:59
Line 1549  lancement_thread_signaux(struct_processu Line 1549  lancement_thread_signaux(struct_processu
         return(d_erreur);          return(d_erreur);
     }      }
   
       if (pthread_attr_destroy(&attributs) != 0)
       {
           (*s_etat_processus).erreur_systeme = d_es_processus;
           return(d_erreur);
       }
   
     return(d_absence_erreur);      return(d_absence_erreur);
 }  }
   
Line 1573  arret_thread_signaux(struct_processus *s Line 1579  arret_thread_signaux(struct_processus *s
   
     pthread_join((*s_etat_processus).thread_signaux, NULL);      pthread_join((*s_etat_processus).thread_signaux, NULL);
   
     close((*s_etat_processus).pipe_signaux[0]);  
     close((*s_etat_processus).pipe_signaux[1]);      close((*s_etat_processus).pipe_signaux[1]);
   
     return(d_absence_erreur);      return(d_absence_erreur);
 }  }
   
Line 1596  thread_signaux(void *argument) Line 1600  thread_signaux(void *argument)
     pipe = (*s_etat_processus).pipe_signaux;      pipe = (*s_etat_processus).pipe_signaux;
     fds.fd = pipe[0];      fds.fd = pipe[0];
     fds.events = POLLIN;      fds.events = POLLIN;
     fds.revents = 0;  
   
     sigfillset(&masque);      sigfillset(&masque);
     pthread_sigmask(SIG_BLOCK, &masque, NULL);      pthread_sigmask(SIG_BLOCK, &masque, NULL);
   
     do      do
     {      {
         if (poll(&fds, 1, -1) == -1)          fds.revents = 0;
   
           while(poll(&fds, 1, -1) == -1)
         {          {
             pthread_exit(NULL);              if (errno != EINTR)
               {
                   close((*s_etat_processus).pipe_signaux[0]);
                   pthread_exit(NULL);
               }
         }          }
   
         if (read_atomic(s_etat_processus, fds.fd, &signal, 1) != 1)          if (read_atomic(s_etat_processus, fds.fd, &signal, 1) != 1)
         {          {
               close((*s_etat_processus).pipe_signaux[0]);
             pthread_exit(NULL);              pthread_exit(NULL);
         }          }
   
Line 1621  thread_signaux(void *argument) Line 1631  thread_signaux(void *argument)
         }          }
     } while(signal != (0xFF & rpl_sigmax));      } while(signal != (0xFF & rpl_sigmax));
   
       close((*s_etat_processus).pipe_signaux[0]);
     pthread_exit(NULL);      pthread_exit(NULL);
 }  }
   
Line 3411  creation_queue_signaux(struct_processus Line 3422  creation_queue_signaux(struct_processus
         return;          return;
     }      }
   
 #   ifdef SCHED_OTHER      if (pthread_create(&((*s_queue_signaux).thread_signaux), &attributs,
     if (pthread_attr_setschedpolicy(&attributs, SCHED_OTHER) != 0)              thread_surveillance_signaux, s_etat_processus) != 0)
     {  
         (*s_etat_processus).erreur_systeme = d_es_processus;  
         return;  
     }  
 #   endif  
   
 #   ifdef PTHREAD_EXPLICIT_SCHED  
     if (pthread_attr_setinheritsched(&attributs, PTHREAD_EXPLICIT_SCHED) != 0)  
     {  
         (*s_etat_processus).erreur_systeme = d_es_processus;  
         return;  
     }  
 #   endif  
   
 #   ifdef PTHREAD_SCOPE_SYSTEM  
     if (pthread_attr_setscope(&attributs, PTHREAD_SCOPE_SYSTEM) != 0)  
     {      {
         (*s_etat_processus).erreur_systeme = d_es_processus;          (*s_etat_processus).erreur_systeme = d_es_processus;
         return;          return;
     }      }
 #   endif  
   
     if (pthread_attr_destroy(&attributs) != 0)      if (pthread_attr_destroy(&attributs) != 0)
     {      {
         (*s_etat_processus).erreur_systeme = d_es_processus;          (*s_etat_processus).erreur_systeme = d_es_processus;
         return;          return;
     }  
   
     if (pthread_create(&((*s_queue_signaux).thread_signaux), &attributs,  
             thread_surveillance_signaux, s_etat_processus) != 0)  
     {  
         (*s_etat_processus).erreur_systeme = d_es_processus;  
         return;  
     }      }
   
     (*s_queue_signaux).controle = getpid();      (*s_queue_signaux).controle = getpid();

Removed from v.1.179  
changed lines
  Added in v.1.180


CVSweb interface <joel.bertrand@systella.fr>