adjust code

This commit is contained in:
mutouyun 2018-12-16 23:22:57 +08:00
parent f09378b481
commit 885abd0c21

View File

@ -155,7 +155,7 @@ void Unit::test_send_recv() {
} }
void Unit::test_channel() { void Unit::test_channel() {
auto conn = [](int id) { auto wait_for_connected = [](int id) {
std::string ack = "copy:" + std::to_string(id); std::string ack = "copy:" + std::to_string(id);
ipc::channel cc { "my-ipc-channel" }; ipc::channel cc { "my-ipc-channel" };
std::atomic_bool unmatched { true }; std::atomic_bool unmatched { true };
@ -189,11 +189,11 @@ void Unit::test_channel() {
}; };
std::thread t1 {[&] { std::thread t1 {[&] {
auto cc = conn(1); auto cc = wait_for_connected(1);
}}; }};
std::thread t2 {[&] { std::thread t2 {[&] {
auto cc = conn(2); auto cc = wait_for_connected(2);
}}; }};
t1.join(); t1.join();