cvs commit: src/sys/kern subr_witness.c
    John Baldwin 
    jhb at FreeBSD.org
       
    Fri Jul  9 10:46:28 PDT 2004
    
    
  
jhb         2004-07-09 17:46:27 UTC
  FreeBSD src repository
  Modified files:
    sys/kern             subr_witness.c 
  Log:
  Check the lock lists to see if they are empty directly rather than
  assigning a pointer to the list and then dereferencing the pointer as a
  second step.  When the first spin lock is acquired, curthread is not in
  a critical section so it may be preempted and would end up using another
  CPUs lock list instead of its own.
  
  When this code was in witness_lock() this sequence was safe as curthread
  was in a critical section already since witness_lock() is called after the
  lock is acquired.
  
  Tested by:      Daniel Lang dl at leo.org
  
  Revision  Changes    Path
  1.175     +21 -9     src/sys/kern/subr_witness.c
    
    
More information about the cvs-all
mailing list