SpiecsEngine
 
Loading...
Searching...
No Matches

◆ TEST() [42/59]

SpicesTest::TEST ( Semaphore_test ,
Sign  )

Testing Spices::Semaphore::Sign.

Definition at line 17 of file Semaphore_test.h.

17 {
18
20
22
23 std::thread t([&]() {
24 std::this_thread::sleep_for(std::chrono::seconds(1));
25 sem.Sign(1);
26 });
27
28 // Should not block here.
29 EXPECT_EQ(sem.GetSign(), 0);
30
31 t.join();
32
33 // Should block here.
34 EXPECT_EQ(sem.GetSign(), 1);
35 }
#define SPICESTEST_PROFILE_FUNCTION()
void Sign(int sign)
Sign this semaphore with specific value.
Definition Semaphore.h:34
const int GetSign() const
Get this semaphore current sign.
Definition Semaphore.h:70
std::semaphore Implementation.
Definition Semaphore.h:16

References Spices::semaphore::GetSign(), and Spices::semaphore::Sign().