emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/atimer.c


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/atimer.c
Date: Fri, 04 Apr 2003 01:23:46 -0500

Index: emacs/src/atimer.c
diff -c emacs/src/atimer.c:1.11 emacs/src/atimer.c:1.12
*** emacs/src/atimer.c:1.11     Mon Oct  8 05:42:04 2001
--- emacs/src/atimer.c  Tue Feb  4 09:03:11 2003
***************
*** 132,143 ****
      case ATIMER_ABSOLUTE:
        t->expiration = time;
        break;
!       
      case ATIMER_RELATIVE:
        EMACS_GET_TIME (t->expiration);
        EMACS_ADD_TIME (t->expiration, t->expiration, time);
        break;
!       
      case ATIMER_CONTINUOUS:
        EMACS_GET_TIME (t->expiration);
        EMACS_ADD_TIME (t->expiration, t->expiration, time);
--- 132,143 ----
      case ATIMER_ABSOLUTE:
        t->expiration = time;
        break;
! 
      case ATIMER_RELATIVE:
        EMACS_GET_TIME (t->expiration);
        EMACS_ADD_TIME (t->expiration, t->expiration, time);
        break;
! 
      case ATIMER_CONTINUOUS:
        EMACS_GET_TIME (t->expiration);
        EMACS_ADD_TIME (t->expiration, t->expiration, time);
***************
*** 151,157 ****
  
    /* Arrange for a SIGALRM at the time the next atimer is ripe.  */
    set_alarm ();
!   
    return t;
  }
  
--- 151,157 ----
  
    /* Arrange for a SIGALRM at the time the next atimer is ripe.  */
    set_alarm ();
! 
    return t;
  }
  
***************
*** 163,176 ****
       struct atimer *timer;
  {
    int i;
!   
    BLOCK_ATIMERS;
  
    for (i = 0; i < 2; ++i)
      {
        struct atimer *t, *prev;
        struct atimer **list = i ? &stopped_atimers : &atimers;
!       
        /* See if TIMER is active or stopped.  */
        for (t = *list, prev = NULL; t && t != timer; prev = t, t = t->next)
        ;
--- 163,176 ----
       struct atimer *timer;
  {
    int i;
! 
    BLOCK_ATIMERS;
  
    for (i = 0; i < 2; ++i)
      {
        struct atimer *t, *prev;
        struct atimer **list = i ? &stopped_atimers : &atimers;
! 
        /* See if TIMER is active or stopped.  */
        for (t = *list, prev = NULL; t && t != timer; prev = t, t = t->next)
        ;
***************
*** 184,190 ****
            prev->next = t->next;
          else
            *list = t->next;
!         
          t->next = free_atimers;
          free_atimers = t;
          break;
--- 184,190 ----
            prev->next = t->next;
          else
            *list = t->next;
! 
          t->next = free_atimers;
          free_atimers = t;
          break;
***************
*** 209,215 ****
    else
      {
        struct atimer *p;
!       
        for (p = list1; p->next; p = p->next)
        ;
        p->next = list2;
--- 209,215 ----
    else
      {
        struct atimer *p;
! 
        for (p = list1; p->next; p = p->next)
        ;
        p->next = list2;
***************
*** 225,235 ****
       struct atimer *t;
  {
    BLOCK_ATIMERS;
!   
    if (t)
      {
        struct atimer *p, *prev;
!       
        /* See if T is active.  */
        for (p = atimers, prev = 0; p && p != t; p = p->next)
        ;
--- 225,235 ----
       struct atimer *t;
  {
    BLOCK_ATIMERS;
! 
    if (t)
      {
        struct atimer *p, *prev;
! 
        /* See if T is active.  */
        for (p = atimers, prev = 0; p && p != t; p = p->next)
        ;
***************
*** 246,252 ****
        /* T is not active.  Let's handle this like T == 0.  */
        t = NULL;
      }
!   
    stopped_atimers = append_atimer_lists (atimers, stopped_atimers);
    atimers = t;
    UNBLOCK_ATIMERS;
--- 246,252 ----
        /* T is not active.  Let's handle this like T == 0.  */
        t = NULL;
      }
! 
    stopped_atimers = append_atimer_lists (atimers, stopped_atimers);
    atimers = t;
    UNBLOCK_ATIMERS;
***************
*** 263,280 ****
      {
        struct atimer *t = atimers;
        struct atimer *next;
!       
        BLOCK_ATIMERS;
        atimers = stopped_atimers;
        stopped_atimers = NULL;
!       
        while (t)
        {
          next = t->next;
          schedule_atimer (t);
          t = next;
        }
!       
        UNBLOCK_ATIMERS;
      }
  }
--- 263,280 ----
      {
        struct atimer *t = atimers;
        struct atimer *next;
! 
        BLOCK_ATIMERS;
        atimers = stopped_atimers;
        stopped_atimers = NULL;
! 
        while (t)
        {
          next = t->next;
          schedule_atimer (t);
          t = next;
        }
! 
        UNBLOCK_ATIMERS;
      }
  }
***************
*** 301,307 ****
       must reestablish each time.  */
    signal (SIGALRM, alarm_signal_handler);
  #endif /* USG */
!   
    if (atimers)
      {
        EMACS_TIME now, time;
--- 301,307 ----
       must reestablish each time.  */
    signal (SIGALRM, alarm_signal_handler);
  #endif /* USG */
! 
    if (atimers)
      {
        EMACS_TIME now, time;
***************
*** 320,326 ****
          EMACS_SET_SECS (time, 0);
          EMACS_SET_USECS (time, 1000);
        }
!       
        bzero (&it, sizeof it);
        it.it_value = time;
        setitimer (ITIMER_REAL, &it, 0);
--- 320,326 ----
          EMACS_SET_SECS (time, 0);
          EMACS_SET_USECS (time, 1000);
        }
! 
        bzero (&it, sizeof it);
        it.it_value = time;
        setitimer (ITIMER_REAL, &it, 0);
***************
*** 350,356 ****
      prev->next = t;
    else
      atimers = t;
!   
    t->next = a;
  }
  
--- 350,356 ----
      prev->next = t;
    else
      atimers = t;
! 
    t->next = a;
  }
  
***************
*** 363,382 ****
       int signo;
  {
    EMACS_TIME now;
!   
    EMACS_GET_TIME (now);
    pending_atimers = 0;
!   
    while (atimers
         && (pending_atimers = interrupt_input_blocked) == 0
         && EMACS_TIME_LE (atimers->expiration, now))
      {
        struct atimer *t;
!       
        t = atimers;
        atimers = atimers->next;
        t->fn (t);
!       
        if (t->type == ATIMER_CONTINUOUS)
        {
          EMACS_ADD_TIME (t->expiration, now, t->interval);
--- 363,382 ----
       int signo;
  {
    EMACS_TIME now;
! 
    EMACS_GET_TIME (now);
    pending_atimers = 0;
! 
    while (atimers
         && (pending_atimers = interrupt_input_blocked) == 0
         && EMACS_TIME_LE (atimers->expiration, now))
      {
        struct atimer *t;
! 
        t = atimers;
        atimers = atimers->next;
        t->fn (t);
! 
        if (t->type == ATIMER_CONTINUOUS)
        {
          EMACS_ADD_TIME (t->expiration, now, t->interval);
***************
*** 387,396 ****
          t->next = free_atimers;
          free_atimers = t;
        }
!       
        EMACS_GET_TIME (now);
      }
!   
    set_alarm ();
  }
  
--- 387,396 ----
          t->next = free_atimers;
          free_atimers = t;
        }
! 
        EMACS_GET_TIME (now);
      }
! 
    set_alarm ();
  }
  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]