|
KallistiOS git master
Independent SDK for the Sega Dreamcast
|
#include <stdio.h>#include <stdlib.h>#include <stdint.h>#include <stdbool.h>#include <limits.h>#include <threads.h>#include <stdatomic.h>Macros | |
| #define | THREAD_COUNT 20 /* # of threads to spawn */ |
| #define | ITERATION_COUNT 5 /* # of times to iterate over each atomic */ |
| #define | BUFFER_SIZE 4096 /* # of bytes in atomic buffer */ |
| #define | BUFFER_UPDATE_COUNT 100 /* # of times to update atomic buffer */ |
Functions | |
| static | _Atomic (uint8_t) |
| static void | atomic_add_buffer (unsigned tid, int delta) |
| static int | thread (void *arg) |
| int | main (int arg, char *argv[]) |
Variables | |
| static atomic_flag | flag_atomic = ATOMIC_FLAG_INIT |
| static atomic_bool | bool_atomic = false |
| static atomic_int | int_atomic = INT_MAX |
| static _Atomic uint64_t | longlong_atomic = 0 |
| #define BUFFER_SIZE 4096 /* # of bytes in atomic buffer */ |
| #define ITERATION_COUNT 5 /* # of times to iterate over each atomic */ |
| #define THREAD_COUNT 20 /* # of threads to spawn */ |
Referenced by main().
|
static |
Referenced by reentrant_mutex_lock(), and reentrant_mutex_unlock().
|
static |
| int main | ( | int | arg, |
| char * | argv[] ) |
References bool_atomic, flag_atomic, fprintf, int_atomic, ITERATION_COUNT, longlong_atomic, printf, thrd_create(), thrd_error, thrd_join(), thrd_success, thread(), and THREAD_COUNT.
|
static |
References atomic_add_buffer(), bool_atomic, BUFFER_UPDATE_COUNT, flag_atomic, fprintf, int_atomic, ITERATION_COUNT, longlong_atomic, NULL, printf, thrd_sleep(), and thrd_yield().
Referenced by main(), and test_scoped_lock().