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

Function TEST

common/executor/test/test_async.cpp:52–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52TEST(std_executor, test) {
53 photon::Executor eth;
54
55 for (int i = 0; i < 10; i++) {
56 ftask(&eth, i);
57 }
58 EXPECT_LT(count.load(), 10);
59 printf("Task applied, wait for loop\n");
60 while (count.load() != 10) {
61 std::this_thread::sleep_for(std::chrono::milliseconds(100));
62 }
63 EXPECT_EQ(10, start.load());
64 EXPECT_EQ(start.load(), count.load());
65}
66
67TEST(std_executor, perf) {
68 int cnt = 0;

Callers

nothing calls this directly

Calls 11

set_cpu_affinityFunction · 0.85
reserveMethod · 0.80
ftaskFunction · 0.70
sleep_forFunction · 0.50
DECFunction · 0.50
loadMethod · 0.45
emplace_backMethod · 0.45
async_performMethod · 0.45
joinMethod · 0.45
countMethod · 0.45
commaMethod · 0.45

Tested by

no test coverage detected