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

Function ftask

common/executor/test/test_async.cpp:38–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36static constexpr int app_num = 10000;
37
38int ftask(photon::Executor *eth, int i) {
39 LOG_TEMP("Add one");
40 eth->async_perform(new auto ([i] {
41 // sleep for 3 secs
42 LOG_INFO("Async work ` start", i);
43 start++;
44 photon::thread_sleep(3);
45 LOG_INFO("Async work ` done", i);
46 count++;
47 }));
48 LOG_TEMP("Add one done");
49 return 0;
50}
51
52TEST(std_executor, test) {
53 photon::Executor eth;

Callers 1

TESTFunction · 0.70

Calls 2

thread_sleepFunction · 0.50
async_performMethod · 0.45

Tested by

no test coverage detected