labath added a comment.

I never expected we would have so many callbacks that we'd have to worry about 
this, but yes, this is one way to fix the problem. Another (slightly simpler, 
but also less performant) would be to make the write pipe nonblocking, and do 
not treat EAGAIN as an error.



================
Comment at: lldb/source/Host/posix/MainLoopPosix.cpp:408
   assert(bytes_written == 1);
+  m_trigger_done = true;
 }
----------------
I /think/ this is not right. The other thread can wake up as soon as the Write 
call is done, and can proceed to clear the `done` flag before we are able to 
set it. If we set it afterwards, then we we suppress all subsequent writes, and 
the callbacks would never run. If we set the flag before we make the Write 
call, then it should be ok -- though the flag should probably have a different 
name then.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135516/new/

https://reviews.llvm.org/D135516

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to