lock should be get before checking whether listener_ is nullptr or not.
Change-Id: Ied8d03d9bc772542837d7f8b5f2eb1ad8a61c5e9
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
if (ev == nullptr)
return RPC_PORT_ERROR_INVALID_PARAMETER;
+ std::lock_guard<std::recursive_mutex> lock(GetMutex());
if (listener_ != nullptr) {
_E("Already listening!"); // LCOV_EXCL_LINE
return RPC_PORT_ERROR_INVALID_PARAMETER; // LCOV_EXCL_LINE
}
- std::lock_guard<std::recursive_mutex> lock(GetMutex());
listener_ = ev;
server_.reset(new Server(fd, this));
return server_->Listen();