Changeset 508b0df1 in mainline for uspace/app/wavplay


Ignore:
Timestamp:
2018-09-06T20:21:52Z (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:
78de83de, fc10e1b
Parents:
4621d23
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-13 03:53:39)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-09-06 20:21:52)
Message:

Remove uspace <atomic.h>, use <stdatomic.h> instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/wavplay/main.c

    r4621d23 r508b0df1  
    3535
    3636#include <assert.h>
    37 #include <atomic.h>
     37#include <stdatomic.h>
    3838#include <errno.h>
    3939#include <fibril_synch.h>
     
    189189typedef struct {
    190190        hound_context_t *ctx;
    191         atomic_t *count;
     191        atomic_int *count;
    192192        const char *file;
    193193} fib_play_t;
     
    203203        fib_play_t *p = arg;
    204204        const errno_t ret = hplay_ctx(p->ctx, p->file);
    205         atomic_dec(p->count);
     205        atomic_fetch_sub(p->count, 1);
    206206        free(arg);
    207207        return ret;
     
    279279        /* Init parallel playback variables */
    280280        hound_context_t *hound_ctx = NULL;
    281         atomic_t playcount;
    282         atomic_set(&playcount, 0);
     281        atomic_int playcount = 0;
    283282
    284283        /* Init parallel playback context if necessary */
     
    332331                                data->ctx = hound_ctx;
    333332                                fid_t fid = fibril_create(play_wrapper, data);
    334                                 atomic_inc(&playcount);
     333                                atomic_fetch_add(&playcount, 1);
    335334                                fibril_add_ready(fid);
    336335                        } else {
     
    341340
    342341        /* Wait for all fibrils to finish */
    343         while (atomic_get(&playcount) > 0)
     342        while (atomic_load(&playcount) > 0)
    344343                fibril_usleep(1000000);
    345344
Note: See TracChangeset for help on using the changeset viewer.