TestEventSignal.h 691 B

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #pragma once
  9. #include <AzCore/std/parallel/binary_semaphore.h>
  10. #include <AzCore/std/parallel/atomic.h>
  11. namespace UnitTests
  12. {
  13. class TestEventPair
  14. {
  15. AZStd::atomic_bool m_signaled{ false };
  16. AZStd::thread_id m_threadId;
  17. AZStd::binary_semaphore m_event;
  18. public:
  19. void Signal();
  20. bool WaitAndCheck();
  21. };
  22. enum TestEvents : int
  23. {
  24. Added = 0,
  25. Modified,
  26. Deleted,
  27. NumEvents
  28. };
  29. }