[Lldb-commits] [PATCH] D60496: [lldb-server] Update tests to use std::thread/mutex for all platforms

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Apr 11 23:24:04 PDT 2019


labath accepted this revision.
labath added a comment.

LGTM.

The ifdefs for the getpid() code and stuff are unfortunate, but I am not sure if using llvm libraries for that is a good idea. Right now we have the ability to compile the tests for a different architecture than the one lldb is built for. If we started using non-standard facilities in the tests, this would become a lot more complicated.



================
Comment at: packages/Python/lldbsuite/test/tools/lldb-server/main.cpp:188-192
+    g_print_mutex.lock();
     printf("thread %d id: ", this_thread_index);
     print_thread_id();
     printf("\n");
+    g_print_mutex.unlock();
----------------
asmith wrote:
> labath wrote:
> > use std::scoped_lock instead of manual lock/unlock calls (throughout the patch).
> Is cxx17 now officially okay to use?
> 
Sorry, I meant std::lock_guard here (and I see that you have used that). c++17 is not ok do be used in real code. Tests can theoretically have different (stricter, or more lax) requirements, but I don't see a reason to deviate from the official policy here.


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

https://reviews.llvm.org/D60496





More information about the lldb-commits mailing list