|
@@ -18,7 +18,7 @@ static ErrorOr<void> test_once()
|
|
|
|
|
|
static Vector<int> v;
|
|
|
v.clear();
|
|
|
- pthread_once_t once = PTHREAD_ONCE_INIT;
|
|
|
+ IGNORE_USE_IN_ESCAPING_LAMBDA pthread_once_t once = PTHREAD_ONCE_INIT;
|
|
|
Vector<NonnullRefPtr<Threading::Thread>, threads_count> threads;
|
|
|
|
|
|
for (size_t i = 0; i < threads_count; i++) {
|
|
@@ -44,9 +44,9 @@ static ErrorOr<void> test_mutex()
|
|
|
constexpr size_t threads_count = 10;
|
|
|
constexpr size_t num_times = 100;
|
|
|
|
|
|
- Vector<int> v;
|
|
|
+ IGNORE_USE_IN_ESCAPING_LAMBDA Vector<int> v;
|
|
|
Vector<NonnullRefPtr<Threading::Thread>, threads_count> threads;
|
|
|
- pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
|
+ IGNORE_USE_IN_ESCAPING_LAMBDA pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
|
|
|
|
for (size_t i = 0; i < threads_count; i++) {
|
|
|
threads.unchecked_append(TRY(Threading::Thread::try_create([&] {
|
|
@@ -77,9 +77,9 @@ static ErrorOr<void> test_semaphore_as_lock()
|
|
|
constexpr size_t threads_count = 10;
|
|
|
constexpr size_t num_times = 100;
|
|
|
|
|
|
- Vector<int> v;
|
|
|
+ IGNORE_USE_IN_ESCAPING_LAMBDA Vector<int> v;
|
|
|
Vector<NonnullRefPtr<Threading::Thread>, threads_count> threads;
|
|
|
- sem_t semaphore;
|
|
|
+ IGNORE_USE_IN_ESCAPING_LAMBDA sem_t semaphore;
|
|
|
sem_init(&semaphore, 0, 1);
|
|
|
|
|
|
for (size_t i = 0; i < threads_count; i++) {
|
|
@@ -109,8 +109,8 @@ static ErrorOr<void> test_semaphore_as_lock()
|
|
|
|
|
|
static ErrorOr<void> test_semaphore_as_event()
|
|
|
{
|
|
|
- Vector<int> v;
|
|
|
- sem_t semaphore;
|
|
|
+ IGNORE_USE_IN_ESCAPING_LAMBDA Vector<int> v;
|
|
|
+ IGNORE_USE_IN_ESCAPING_LAMBDA sem_t semaphore;
|
|
|
sem_init(&semaphore, 0, 0);
|
|
|
|
|
|
auto reader = TRY(Threading::Thread::try_create([&] {
|
|
@@ -144,11 +144,11 @@ static ErrorOr<void> test_semaphore_nonbinary()
|
|
|
constexpr size_t num_times = 100;
|
|
|
|
|
|
Vector<NonnullRefPtr<Threading::Thread>, threads_count> threads;
|
|
|
- sem_t semaphore;
|
|
|
+ IGNORE_USE_IN_ESCAPING_LAMBDA sem_t semaphore;
|
|
|
sem_init(&semaphore, 0, num);
|
|
|
|
|
|
- Atomic<u32, AK::memory_order_relaxed> value = 0;
|
|
|
- Atomic<bool, AK::memory_order_relaxed> seen_more_than_two = false;
|
|
|
+ IGNORE_USE_IN_ESCAPING_LAMBDA Atomic<u32, AK::memory_order_relaxed> value = 0;
|
|
|
+ IGNORE_USE_IN_ESCAPING_LAMBDA Atomic<bool, AK::memory_order_relaxed> seen_more_than_two = false;
|
|
|
|
|
|
for (size_t i = 0; i < threads_count; i++) {
|
|
|
threads.unchecked_append(TRY(Threading::Thread::try_create([&] {
|