<!-- description --> @brief Used to test to make sure that threads have to wait
| 51 | /// @brief Used to test to make sure that threads have to wait |
| 52 | /// |
| 53 | void |
| 54 | thread_func(bsl::safe_u16 const &ppid) noexcept |
| 55 | { |
| 56 | bool mut_this_thread_waited{}; |
| 57 | |
| 58 | auto *const pmut_tls{g_mut_tls_wait.at_if(bsl::to_idx(ppid))}; |
| 59 | pmut_tls->ppid = ppid.get(); |
| 60 | |
| 61 | ++g_mut_threads_started; |
| 62 | |
| 63 | g_mut_spinlock.lock(*pmut_tls); |
| 64 | while (static_cast<bsl::uint64>(g_mut_threads_started) < MAX_WAIT_THREADS) { |
| 65 | if (!mut_this_thread_waited) { |
| 66 | ++g_mut_threads_that_waited; |
| 67 | mut_this_thread_waited = true; |
| 68 | } |
| 69 | |
| 70 | helpers::yield(); |
| 71 | } |
| 72 | g_mut_spinlock.unlock(); |
| 73 | } |
| 74 | |
| 75 | /// <!-- description --> |
| 76 | /// @brief Used to execute the actual checks. We put the checks in this |