Changeset fc10e1b in mainline for kernel/test/mm/falloc2.c


Ignore:
Timestamp:
2018-09-07T16:34:11Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d2c91ab
Parents:
508b0df1 (diff), e90cfa6 (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.
Message:

Merge branch 'atomic'

Use more of <stdatomic.h> in kernel. Increment/decrement macros kept because
the are handy. atomic_t currently kept because I'm way too lazy to go through
all uses and think about the most appropriate replacement.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/mm/falloc2.c

    r508b0df1 rfc10e1b  
    117117const char *test_falloc2(void)
    118118{
    119         atomic_set(&thread_count, THREADS);
    120         atomic_set(&thread_fail, 0);
     119        atomic_store(&thread_count, THREADS);
     120        atomic_store(&thread_fail, 0);
    121121
    122122        for (unsigned int i = 0; i < THREADS; i++) {
     
    130130        }
    131131
    132         while (atomic_get(&thread_count) > 0) {
    133                 TPRINTF("Threads left: %" PRIua "\n",
    134                     atomic_get(&thread_count));
     132        while (atomic_load(&thread_count) > 0) {
     133                TPRINTF("Threads left: %zu\n",
     134                    atomic_load(&thread_count));
    135135                thread_sleep(1);
    136136        }
    137137
    138         if (atomic_get(&thread_fail) == 0)
     138        if (atomic_load(&thread_fail) == 0)
    139139                return NULL;
    140140
Note: See TracChangeset for help on using the changeset viewer.