Commit ae2b9383 authored by Martin Hurton's avatar Martin Hurton

register_endpoint: simplify locking

parent e56f6980
......@@ -297,13 +297,14 @@ int zmq::ctx_t::register_endpoint (const char *addr_, endpoint_t &endpoint_)
bool inserted = endpoints.insert (endpoints_t::value_type (
std::string (addr_), endpoint_)).second;
endpoints_sync.unlock ();
if (!inserted) {
errno = EADDRINUSE;
endpoints_sync.unlock ();
return -1;
}
endpoints_sync.unlock ();
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment