mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-29 20:59:47 +01:00
Problem: race conditions for options.linger (#2910)
* Problem: race conditions for options.linger Solution: make options.linger atomic
This commit is contained in:
committed by
Luca Boccassi
parent
de0c669323
commit
a1d55d0506
@@ -216,7 +216,7 @@ int zmq::options_t::setsockopt (int option_,
|
||||
|
||||
case ZMQ_LINGER:
|
||||
if (is_int && value >= -1) {
|
||||
linger = value;
|
||||
linger.store (value);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
@@ -733,7 +733,7 @@ int zmq::options_t::getsockopt (int option_,
|
||||
|
||||
case ZMQ_LINGER:
|
||||
if (is_int) {
|
||||
*value = linger;
|
||||
*value = linger.load ();
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user