Changeset 508b0df1 in mainline for uspace/app/wavplay
- Timestamp:
- 2018-09-06T20:21:52Z (7 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wavplay/main.c
r4621d23 r508b0df1 35 35 36 36 #include <assert.h> 37 #include < atomic.h>37 #include <stdatomic.h> 38 38 #include <errno.h> 39 39 #include <fibril_synch.h> … … 189 189 typedef struct { 190 190 hound_context_t *ctx; 191 atomic_ t *count;191 atomic_int *count; 192 192 const char *file; 193 193 } fib_play_t; … … 203 203 fib_play_t *p = arg; 204 204 const errno_t ret = hplay_ctx(p->ctx, p->file); 205 atomic_ dec(p->count);205 atomic_fetch_sub(p->count, 1); 206 206 free(arg); 207 207 return ret; … … 279 279 /* Init parallel playback variables */ 280 280 hound_context_t *hound_ctx = NULL; 281 atomic_t playcount; 282 atomic_set(&playcount, 0); 281 atomic_int playcount = 0; 283 282 284 283 /* Init parallel playback context if necessary */ … … 332 331 data->ctx = hound_ctx; 333 332 fid_t fid = fibril_create(play_wrapper, data); 334 atomic_ inc(&playcount);333 atomic_fetch_add(&playcount, 1); 335 334 fibril_add_ready(fid); 336 335 } else { … … 341 340 342 341 /* Wait for all fibrils to finish */ 343 while (atomic_ get(&playcount) > 0)342 while (atomic_load(&playcount) > 0) 344 343 fibril_usleep(1000000); 345 344
Note:
See TracChangeset
for help on using the changeset viewer.