| | |
| | | // 2) find remote queue first, then build msg; |
| | | // 1 is about 50% faster than 2, maybe cache related. |
| | | |
| | | bool ShmMsgQueue::Recv(BHMsg &msg, const int timeout_ms) |
| | | { |
| | | MsgI imsg; |
| | | if (Read(imsg, timeout_ms)) { |
| | | DEFER1(imsg.Release(shm());); |
| | | return imsg.Unpack(msg); |
| | | } else { |
| | | return false; |
| | | } |
| | | } |
| | | // bool ShmMsgQueue::Recv(MsgI &imsg, BHMsgHead &head, const int timeout_ms) |
| | | // { |
| | | // if (Read(imsg, timeout_ms)) { |
| | | // // DEFER1(imsg.Release(shm());); |
| | | // return imsg.ParseHead(head); |
| | | // } else { |
| | | // return false; |
| | | // } |
| | | // } |
| | | |
| | | } // namespace bhome_shm |