diff --git a/include/llvm/ExecutionEngine/Orc/RawByteChannel.h b/include/llvm/ExecutionEngine/Orc/RawByteChannel.h index 43b597de000..83a7b9a844f 100644 --- a/include/llvm/ExecutionEngine/Orc/RawByteChannel.h +++ b/include/llvm/ExecutionEngine/Orc/RawByteChannel.h @@ -47,9 +47,9 @@ public: /// Locks the channel for writing. template Error startSendMessage(const FunctionIdT &FnId, const SequenceIdT &SeqNo) { + writeLock.lock(); if (auto Err = serializeSeq(*this, FnId, SeqNo)) return Err; - writeLock.lock(); return Error::success(); }