Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When release is invoked, we first validate that the top of the stack is equal to the thread-local variable. If it is not equal, it means that a callback didn't wait for the other thread to complete invoking the consumer. After the check we pop the top value of the access-key stack, and then restore restore the thread-local variable to its previous value. The thread-local variable is restored by copying the new top of the stack to the thread-local variableinto it, or if the stack is now empty we clear the thread-local variable.

...