================
@@ -574,10 +581,10 @@ int Editline::GetCharacter(EditLineGetCharType *c) {
     // indefinitely. This gives a chance for someone to interrupt us. After
     // Read returns, immediately lock the mutex again and check if we were
     // interrupted.
-    m_output_mutex.unlock();
+    m_output_stream_sp->GetMutex().unlock();
----------------
labath wrote:

What would you say if, instead of exposing rather non-RAII method on the 
generic class, we worked around this issue (the issue being us wanting to put 
libedit code in a critical section) locally, by having something like 
`std::optional<LockedStream> m_locked_output` member on the editline class? 
GetLine could set this member when doing its work, and here we would clear it 
before blocking, and re-set it immediately afterwards.

https://github.com/llvm/llvm-project/pull/126630
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to