Changeset 0b9ac3c in mainline for uspace/lib/libc/include/atomicdflt.h


Ignore:
Timestamp:
2010-02-23T19:03:28Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c62d2e1
Parents:
1ccafee (diff), 5e50394 (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 mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libc/include/atomicdflt.h

    r1ccafee r0b9ac3c  
    3737
    3838#ifndef LIBC_ARCH_ATOMIC_H_
    39 #error This file cannot be included directly, include atomic.h instead.
     39        #error This file cannot be included directly, include atomic.h instead.
    4040#endif
    4141
     42#include <stdint.h>
    4243#include <bool.h>
    4344
    4445typedef struct atomic {
    45         volatile long count;
     46        volatile atomic_count_t count;
    4647} atomic_t;
    4748
    48 static inline void atomic_set(atomic_t *val, long i)
     49static inline void atomic_set(atomic_t *val, atomic_count_t i)
    4950{
    50         val->count = i;
     51        val->count = i;
    5152}
    5253
    53 static inline long atomic_get(atomic_t *val)
     54static inline atomic_count_t atomic_get(atomic_t *val)
    5455{
    55         return val->count;
     56        return val->count;
    5657}
    5758
    58 #ifndef CAS 
    59 static inline bool cas(atomic_t *val, long ov, long nv)
     59#ifndef CAS
     60static inline bool cas(atomic_t *val, atomic_count_t ov, atomic_count_t nv)
    6061{
    6162        return __sync_bool_compare_and_swap(&val->count, ov, nv);
Note: See TracChangeset for help on using the changeset viewer.