Changeset 8a9a41e in mainline for kernel/test/thread/thread1.c


Ignore:
Timestamp:
2021-10-24T08:28:43Z (3 years ago)
Author:
GitHub <noreply@…>
Children:
f628215
Parents:
2ce943a (diff), cd981f2a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Erik Kučák <35500848+Riko196@…> (2021-10-24 08:28:43)
git-committer:
GitHub <noreply@…> (2021-10-24 08:28:43)
Message:

Merge branch 'HelenOS:master' into master

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/thread/thread1.c

    r2ce943a r8a9a41e  
    3030#include <test.h>
    3131#include <atomic.h>
     32#include <stdbool.h>
    3233#include <proc/thread.h>
    3334
     
    3637#define THREADS  5
    3738
    38 static atomic_t finish;
    39 static atomic_t threads_finished;
     39static atomic_bool finish;
     40static atomic_size_t threads_finished;
    4041
    4142static void threadtest(void *data)
     
    5556        size_t total = 0;
    5657
    57         atomic_store(&finish, 1);
     58        atomic_store(&finish, true);
    5859        atomic_store(&threads_finished, 0);
    5960
     
    7273        thread_sleep(10);
    7374
    74         atomic_store(&finish, 0);
     75        atomic_store(&finish, false);
    7576        while (atomic_load(&threads_finished) < total) {
    7677                TPRINTF("Threads left: %zu\n", total - atomic_load(&threads_finished));
Note: See TracChangeset for help on using the changeset viewer.