/[rtmk]/rtmk/timer.c
ViewVC logotype

Diff of /rtmk/timer.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by jrydberg, Thu Jan 3 01:32:43 2002 UTC revision 1.4 by jrydberg, Mon Jan 7 01:16:21 2002 UTC
# Line 206  timer_interrupt (bool usermode_p) Line 206  timer_interrupt (bool usermode_p)
206    usermode_p ? timer_bump (&THREAD_CURRENT ()->timer_user, CLOCK_RESOLUTION)    usermode_p ? timer_bump (&THREAD_CURRENT ()->timer_user, CLOCK_RESOLUTION)
207               : timer_bump (&THREAD_CURRENT ()->timer_system, CLOCK_RESOLUTION);               : timer_bump (&THREAD_CURRENT ()->timer_system, CLOCK_RESOLUTION);
208    
209    /* Increase timestamp counter.  */    if (CPU_CURRENT () == master_cpu)
   
   ATOMIC_ADD (&timestamp_count, 1);  
   
   /* See if we need to wake up the callout thread.  */  
   
   spin_lock (&callout_list_lock);  
   
   if (! queue_empty (&callout_list))  
210      {      {
211        struct callout_entry *entry;        /* Increase timestamp counter.  */
212          
213        entry = (struct callout_entry *) queue_first (&callout_list);        ATOMIC_ADD (&timestamp_count, 1);
214          
215        if (timestamp_count >= entry->timestamp)        /* See if we need to wake up the callout thread.  */
216          
217          spin_lock (&callout_list_lock);
218          
219          if (! queue_empty (&callout_list))
220          {          {
221            spin_unlock (&callout_list_lock);            struct callout_entry *entry;
222            thread_wakeup ((int) &callout_list);            
223            spin_lock (&callout_list_lock);            entry = (struct callout_entry *) queue_first (&callout_list);
224              
225              if (timestamp_count >= entry->timestamp)
226                {
227                  spin_unlock (&callout_list_lock);
228                  thread_wakeup ((int) &callout_list);
229                  spin_lock (&callout_list_lock);
230                }
231          }          }
     }  
232    
233    spin_unlock (&callout_list_lock);        spin_unlock (&callout_list_lock);
234        }
235    
236    /* Update quantum of current thread and block thread. */    /* Update quantum of current thread and block thread. */
237    

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26