bulbazord added inline comments.

================
Comment at: lldb/source/Core/Communication.cpp:41-43
   Clear();
 
+  std::unique_lock guard(m_shared_mutex);
----------------
I think this one //may// be slightly incorrect. Here's how I imagine it going 
wrong:

- Thread 1 calls Connect. It only runs `Clear()` (which disconnects) and then 
Thread 2 is scheduled.
- Thread 2 then calls Connect. It also only runs `Clear()` and then Thread 1 is 
scheduled.
- Thread 1 grabs the lock, connects, and exits.
- Thread 2 also grabs the lock, connects, and exits.

I'm not sure how gracefully `Connection::Connect` handles another connection if 
not properly disconnected from the first url beforehand. Reading through some 
of the `Connection` derived class implementations of `Connect` I'm not sure 
exactly what will happen though. The documentation isn't much clearer either...


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

https://reviews.llvm.org/D157159

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

Reply via email to