mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 09:57:08 +08:00
Fix lock guads in PipePosix.cpp (#90572)
Guard object destroyed immediately after creation without naming.
This commit is contained in:
@@ -108,7 +108,7 @@ Status PipePosix::CreateNew(bool child_processes_inherit) {
|
||||
}
|
||||
|
||||
Status PipePosix::CreateNew(llvm::StringRef name, bool child_process_inherit) {
|
||||
std::scoped_lock<std::mutex, std::mutex> (m_read_mutex, m_write_mutex);
|
||||
std::scoped_lock<std::mutex, std::mutex> guard(m_read_mutex, m_write_mutex);
|
||||
if (CanReadUnlocked() || CanWriteUnlocked())
|
||||
return Status("Pipe is already opened");
|
||||
|
||||
@@ -146,7 +146,7 @@ Status PipePosix::CreateWithUniqueName(llvm::StringRef prefix,
|
||||
|
||||
Status PipePosix::OpenAsReader(llvm::StringRef name,
|
||||
bool child_process_inherit) {
|
||||
std::scoped_lock<std::mutex, std::mutex> (m_read_mutex, m_write_mutex);
|
||||
std::scoped_lock<std::mutex, std::mutex> guard(m_read_mutex, m_write_mutex);
|
||||
|
||||
if (CanReadUnlocked() || CanWriteUnlocked())
|
||||
return Status("Pipe is already opened");
|
||||
|
||||
Reference in New Issue
Block a user