mirror of
https://github.com/boostorg/beast.git
synced 2025-07-31 13:27:33 +02:00
Fix data race in test stream
Resolve: #1594 Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
Version 254:
|
||||||
|
|
||||||
|
* Fix data race in test::stream::connect
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Version 253:
|
Version 253:
|
||||||
|
|
||||||
* Fix async_detect_ssl handler type
|
* Fix async_detect_ssl handler type
|
||||||
|
@@ -262,6 +262,9 @@ connect(stream& remote)
|
|||||||
{
|
{
|
||||||
BOOST_ASSERT(! out_.lock());
|
BOOST_ASSERT(! out_.lock());
|
||||||
BOOST_ASSERT(! remote.out_.lock());
|
BOOST_ASSERT(! remote.out_.lock());
|
||||||
|
std::lock(in_->m, remote.in_->m);
|
||||||
|
std::lock_guard<std::mutex> guard1{in_->m, std::adopt_lock};
|
||||||
|
std::lock_guard<std::mutex> guard2{remote.in_->m, std::adopt_lock};
|
||||||
out_ = remote.in_;
|
out_ = remote.in_;
|
||||||
remote.out_ = in_;
|
remote.out_ = in_;
|
||||||
in_->code = status::ok;
|
in_->code = status::ok;
|
||||||
|
Reference in New Issue
Block a user