mirror of
https://github.com/zeromq/libzmq.git
synced 2025-07-03 17:17:14 +02:00
register_endpoint: simplify locking
This commit is contained in:
parent
e56f698023
commit
ae2b938330
@ -297,13 +297,14 @@ int zmq::ctx_t::register_endpoint (const char *addr_, endpoint_t &endpoint_)
|
|||||||
|
|
||||||
bool inserted = endpoints.insert (endpoints_t::value_type (
|
bool inserted = endpoints.insert (endpoints_t::value_type (
|
||||||
std::string (addr_), endpoint_)).second;
|
std::string (addr_), endpoint_)).second;
|
||||||
|
|
||||||
|
endpoints_sync.unlock ();
|
||||||
|
|
||||||
if (!inserted) {
|
if (!inserted) {
|
||||||
errno = EADDRINUSE;
|
errno = EADDRINUSE;
|
||||||
endpoints_sync.unlock ();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
endpoints_sync.unlock ();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user