From fb605fa4975de54f6fc2d4eaa119a7759584d9f1 Mon Sep 17 00:00:00 2001 From: krynju Date: Sun, 19 Dec 2021 15:03:07 +0100 Subject: [PATCH] add lock around serialize --- stdlib/Distributed/src/remotecall.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/Distributed/src/remotecall.jl b/stdlib/Distributed/src/remotecall.jl index d4bf767537c1d5..41205663c4c6ab 100644 --- a/stdlib/Distributed/src/remotecall.jl +++ b/stdlib/Distributed/src/remotecall.jl @@ -370,7 +370,9 @@ function serialize(s::ClusterSerializer, f::Future) p = worker_id_from_socket(s.io) (p !== f.where) && send_add_client(f, p) end - invoke(serialize, Tuple{ClusterSerializer, Any}, s, f) + @lock f.lock begin + invoke(serialize, Tuple{ClusterSerializer, Any}, s, f) + end end function serialize(s::ClusterSerializer, rr::RemoteChannel)