cvs commit: src/sys/kern lwkt_token.c src/sys/sys thread2.h

Matthew Dillon dillon at
Sun Jun 19 14:51:18 PDT 2005

dillon      2005/06/19 14:50:50 PDT

DragonFly src repository

  Modified files:
    sys/kern             lwkt_token.c 
    sys/sys              thread2.h 
  Fix two bugs in the LWKT token code.
  (1) When releasing a token reference we cannot give away the token to
      another cpu if we are still holding it via a another reference.   This
      can cause recursive token references to silently fail when the inner
      reference is released.  It is unclear where such references exist and
      a temporary printf has been added to identify occurances.
  (2) When obtaining a token reference if the underlying token was not owned
      by the current cpu we spun to gain ownership, but then failed to check
      whether the token was being held by a preempted thread.
      This can result in a preempting thread holding a token also being held
      by an underyling thread.  Theoretically, this case can only
      occur if the preempted thread was is the process of obtaining the
      token in question since otherwise (by definition) our cpu will already
      own the token.  On return the preempted thread will check and obtain
      ownership.  However, the situation is complex enough that we really
      need to check unconditionally.
  Revision  Changes    Path
  1.16      +83 -40    src/sys/kern/lwkt_token.c
  1.20      +3 -0      src/sys/sys/thread2.h

More information about the Commits mailing list