Changeset 508b0df1 in mainline for uspace/srv/hid/console/console.c


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/srv/hid/console/console.c

    r4621d23 r508b0df1  
    3434
    3535#include <async.h>
    36 #include <atomic.h>
    3736#include <stdio.h>
    3837#include <adt/prodcons.h>
     
    5150#include <task.h>
    5251#include <fibril_synch.h>
     52#include <stdatomic.h>
    5353#include <stdlib.h>
    5454#include <str.h>
     
    6161
    6262typedef struct {
    63         atomic_t refcnt;      /**< Connection reference count */
     63        atomic_flag refcnt;      /**< Connection reference count */
    6464        prodcons_t input_pc;  /**< Incoming keyboard events */
    6565
     
    524524        }
    525525
    526         if (atomic_postinc(&cons->refcnt) == 0)
     526        if (!atomic_flag_test_and_set(&cons->refcnt))
    527527                cons_set_cursor_vis(cons, true);
    528528
     
    612612                for (size_t i = 0; i < CONSOLE_COUNT; i++) {
    613613                        consoles[i].index = i;
    614                         atomic_set(&consoles[i].refcnt, 0);
     614                        atomic_flag_clear(&consoles[i].refcnt);
    615615                        fibril_mutex_initialize(&consoles[i].mtx);
    616616                        prodcons_initialize(&consoles[i].input_pc);
Note: See TracChangeset for help on using the changeset viewer.