condition_variable_linux.h 961 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //===-- condition_variable_linux.h ------------------------------*- C++ -*-===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef SCUDO_CONDITION_VARIABLE_LINUX_H_
  9. #define SCUDO_CONDITION_VARIABLE_LINUX_H_
  10. #include "platform.h"
  11. #if SCUDO_LINUX
  12. #include "atomic_helpers.h"
  13. #include "condition_variable_base.h"
  14. #include "thread_annotations.h"
  15. namespace scudo {
  16. class ConditionVariableLinux
  17. : public ConditionVariableBase<ConditionVariableLinux> {
  18. public:
  19. void notifyAllImpl(HybridMutex &M) REQUIRES(M);
  20. void waitImpl(HybridMutex &M) REQUIRES(M);
  21. private:
  22. u32 LastNotifyAll = 0;
  23. atomic_u32 Counter = {};
  24. };
  25. } // namespace scudo
  26. #endif // SCUDO_LINUX
  27. #endif // SCUDO_CONDITION_VARIABLE_LINUX_H_