Changeset 31e15be in mainline for kernel/test/thread/thread1.c


Ignore:
Timestamp:
2021-08-04T15:18:08Z (3 years ago)
Author:
jxsvoboda <5887334+jxsvoboda@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
98a935e
Parents:
de38873
git-author:
Dmitry Selyutin <ghostmansd@…> (2020-12-23 21:59:08)
git-committer:
jxsvoboda <5887334+jxsvoboda@…> (2021-08-04 15:18:08)
Message:

kernel: deprecate atomic_t

File:
1 edited

Legend:

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

    rde38873 r31e15be  
    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.