| 19 | using namespace std; |
| 20 | |
| 21 | int 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([¬ifier]()->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 |
nothing calls this directly
no test coverage detected