conditionVarSpinlockImpl.I 833 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file conditionVarSpinlockImpl.I
  10. * @author drose
  11. * @date 2006-04-11
  12. */
  13. /**
  14. *
  15. */
  16. INLINE ConditionVarSpinlockImpl::
  17. ConditionVarSpinlockImpl(MutexSpinlockImpl &mutex) : _mutex(mutex) {
  18. _event = 0;
  19. }
  20. /**
  21. *
  22. */
  23. INLINE ConditionVarSpinlockImpl::
  24. ~ConditionVarSpinlockImpl() {
  25. }
  26. /**
  27. *
  28. */
  29. INLINE void ConditionVarSpinlockImpl::
  30. notify() {
  31. // This will wake up all waiters on the lock. But that's allowed.
  32. AtomicAdjust::inc(_event);
  33. }
  34. /**
  35. *
  36. */
  37. INLINE void ConditionVarSpinlockImpl::
  38. notify_all() {
  39. AtomicAdjust::inc(_event);
  40. }