1 2 3 4 5 6 7 8 9 10 11
12 /*!
13 * ======== Atomic ========
14 * Simple atomic operations on integers
15 *
16 * This module provides simple "atomic" operations on integral variables.
17 * These operations reliably read, modify, and store a specified value
18 * even in the face of preempting threads that modify the same variables.
19 *
20 * Atomic operations are used as a simple counting semaphore between an
21 * appliation and an interrupt service ruotine, for example.
22 */
23 module Atomic
24 {
25 /*!
26 * ======== inc8 ========
27 * Atomically increment val by 1
28 */
29 @DirectCall
30 Void inc8(UInt8 *val);
31
32 /*!
33 * ======== dec8 ========
34 * Atomically decrement val by 1
35 */
36 @DirectCall
37 Void dec8(UInt8 *val);
38 }