MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / semaphore_test_hold

Function semaphore_test_hold

thread/test/test.cpp:669–687  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

667}
668
669void semaphore_test_hold(semaphore* sem, int &step) {
670 int ret = 0;
671 step++;
672 EXPECT_EQ(1, step);
673 sem->signal(1);
674 LOG_DEBUG("+1");
675 ret = sem->wait(2);
676 EXPECT_EQ(0, ret);
677 LOG_DEBUG("-2");
678 step++;
679 EXPECT_EQ(3, step);
680 sem->signal(3);
681 LOG_DEBUG("+3");
682 ret = sem->wait(4);
683 EXPECT_EQ(0, ret);
684 step++;
685 EXPECT_EQ(5, step);
686 LOG_DEBUG("-4");
687}
688
689void semaphore_test_catch(semaphore* sem, int &step) {
690 int ret = 0;

Callers

nothing calls this directly

Calls 2

signalMethod · 0.45
waitMethod · 0.45

Tested by

no test coverage detected