Changeset e3306d04 in mainline for kernel/test


Ignore:
Timestamp:
2018-09-07T15:54:32Z (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:
5f1d850
Parents:
036e97c
Message:

Convert atomic_t to atomic_size_t (4): Use atomic_store instead of atomic_set

Location:
kernel/test
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • kernel/test/atomic/atomic1.c

    r036e97c re3306d04  
    3636        atomic_t a;
    3737
    38         atomic_set(&a, 10);
     38        atomic_store(&a, 10);
    3939        if (atomic_load(&a) != 10)
    40                 return "Failed atomic_set()/atomic_load()";
     40                return "Failed atomic_store()/atomic_load()";
    4141
    4242        if (atomic_postinc(&a) != 10)
  • kernel/test/mm/falloc2.c

    r036e97c re3306d04  
    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++) {
  • kernel/test/synch/rcu1.c

    r036e97c re3306d04  
    268268static bool do_nop_callbacks(void)
    269269{
    270         atomic_set(&nop_callbacks_cnt, 0);
     270        atomic_store(&nop_callbacks_cnt, 0);
    271271
    272272        size_t exp_cnt = nop_updater_iters * get_thread_cnt();
     
    448448        seq_test_result = EOK;
    449449        max_upd_done_time = 0;
    450         atomic_set(&cur_time, 1);
     450        atomic_store(&cur_time, 1);
    451451
    452452        const size_t iters = 100;
     
    821821{
    822822        barrier_t *b = member_to_inst(item, barrier_t, rcu_item);
    823         atomic_set(&b->done, 1);
     823        atomic_store(&b->done, 1);
    824824}
    825825
     
    835835        }
    836836
    837         atomic_set(&barrier->done, 0);
     837        atomic_store(&barrier->done, 0);
    838838
    839839        rcu_call(&barrier->rcu_item, barrier_callback);
  • kernel/test/synch/semaphore1.c

    r036e97c re3306d04  
    8282                thread_t *thrd;
    8383
    84                 atomic_set(&items_produced, 0);
    85                 atomic_set(&items_consumed, 0);
     84                atomic_store(&items_produced, 0);
     85                atomic_store(&items_consumed, 0);
    8686
    8787                consumers = i * CONSUMERS;
  • kernel/test/synch/workq-test-core.h

    r036e97c re3306d04  
    149149{
    150150        for (int i = 0; i < WAVES; ++i) {
    151                 atomic_set(&call_cnt[i], 0);
     151                atomic_store(&call_cnt[i], 0);
    152152        }
    153153
  • kernel/test/thread/thread1.c

    r036e97c re3306d04  
    5858        atomic_count_t total = 0;
    5959
    60         atomic_set(&finish, 1);
    61         atomic_set(&threads_finished, 0);
     60        atomic_store(&finish, 1);
     61        atomic_store(&threads_finished, 0);
    6262
    6363        for (i = 0; i < THREADS; i++) {
     
    7575        thread_sleep(10);
    7676
    77         atomic_set(&finish, 0);
     77        atomic_store(&finish, 0);
    7878        while (atomic_load(&threads_finished) < total) {
    7979                TPRINTF("Threads left: %zu\n", total - atomic_load(&threads_finished));
Note: See TracChangeset for help on using the changeset viewer.