[Lldb-commits] [PATCH] D129012: [lldb] [test] Improve stability of llgs vCont-threads tests

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 6 02:18:33 PDT 2022


labath added a comment.

Seems like an improvement. I'd like to hear what you make of the inline comment though.

I can also imagine a setup where most of the verification happens inside the inferior. Like, each time a thread gets to run it increments a variable specific to that thread. Once that number crosses some threshold, it check the variables of the other threads, and verifies that one of them has the number zero, and the number of the other thread is reasonably high (> 10% of the threshold or something).



================
Comment at: lldb/test/API/tools/lldb-server/vCont-threads/main.cpp:32
+                  get_thread_id());
+    write(STDOUT_FILENO, buf, strlen(buf));
+
----------------
I am not sure if `write` is an (atomic) system call on windows. Maybe just put a mutex around the printf call? In this setup, I think it would be sufficient to write this once, and then spend the rest of the time making sure the other suspended thread gets a chance to run (if it is not suspended for whatever reason).


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

https://reviews.llvm.org/D129012



More information about the lldb-commits mailing list