MCPcopy Create free account
hub / github.com/Tencent/phxqueue / main

Function main

phxqueue/test/test_notifierpool_main.cpp:21–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19using namespace std;
20
21int main(int argc, char **argv) {
22 unique_ptr<phxqueue::comm::Notifier> notifier = move(phxqueue::comm::NotifierPool::GetInstance()->Get());
23 assert(notifier != nullptr);
24
25 auto t = new thread([&notifier]()->void {
26 cout << "thread 2 begin wait notify ..." << endl;
27 phxqueue::comm::RetCode retcode;
28 notifier->Wait(retcode);
29 cout << "thread 2 recv notify. retcode " << as_integer(retcode) << endl;
30 });
31
32 sleep(1);
33
34 phxqueue::comm::RetCode retcode = phxqueue::comm::RetCode::RET_OK;
35 cout << "thread 1 send notify. retcode " << as_integer(retcode) << endl;
36 notifier->Notify(retcode);
37
38 sleep(1);
39
40 return 0;
41}
42

Callers

nothing calls this directly

Calls 4

as_integerFunction · 0.85
GetMethod · 0.45
WaitMethod · 0.45
NotifyMethod · 0.45

Tested by

no test coverage detected