[clang-format] Rename ExportBlockIndentation -> IndentExportBlock (#123493)
[llvm-project.git] / compiler-rt / test / tsan / many_held_mutex.cpp
blob76e072b35a23368679b4207d8c21dfa15598860f
1 // RUN: %clangxx_tsan -O1 %s %link_libcxx_tsan -fsanitize=thread -o %t
2 // RUN: %run %t 128
4 #include <mutex>
5 #include <string>
6 #include <vector>
8 int main(int argc, char *argv[]) {
9 int num_of_mtx = std::atoi(argv[1]);
11 std::vector<std::mutex> mutexes(num_of_mtx);
13 for (auto &mu : mutexes) {
14 mu.lock();
16 for (auto &mu : mutexes) {
17 mu.unlock();
20 return 0;