|
KallistiOS git master
Independent SDK for the Sega Dreamcast
|
#include <iostream>#include <atomic>#include <array>#include <future>#include <chrono>#include <functional>#include <coroutine>#include <semaphore>#include <thread>#include <barrier>#include <cstdlib>#include <latch>#include <syncstream>#include <shared_mutex>#include <condition_variable>#include <stop_token>#include <span>#include <random>#include <exception>#include <string>#include <dc/wdt.h>Typedefs | |
| using | chamber_t = uint32_t |
Functions | |
| static void | run_semaphore (std::binary_semaphore &sem_main_to_thread, std::binary_semaphore &sem_thread_to_main) |
| static void | test_semaphore () |
| static void | test_latch () |
| static void | test_shared_lock () |
| static void | run_condition_variable (CondVarState &cond_variable_state) |
| static void | test_condition_variable () |
| static void | send_mail (Employee &, Employee &) |
| static void | assign_lunch_partner (Employee &e1, Employee &e2) |
| static void | test_scoped_lock () |
| static void | test_barrier () |
| static void | run_stop_source (int id, std::stop_source stop_source, std::atomic< unsigned > &counter) |
| static void | test_stop_source () |
| static auto | select_chamber () -> chamber_t |
| static auto | player (std::size_t id, bool &fired, trigger_t &trigger) -> user_behavior_t |
| auto | defer (auto &&f) |
| static void | russian_roulette (revolver_t &revolver, std::span< user_behavior_t > users) |
| static void | test_coroutines () |
| int | main (int argc, char *argv[]) |
Variables | |
| constexpr unsigned | WATCHDOG_TIMEOUT = (20 * 1000 * 1000) |
| constexpr int | THREAD_COUNT = 10 |
|
static |
References lock, and send_mail().
Referenced by test_scoped_lock().
| auto defer | ( | auto && | f | ) |
Referenced by russian_roulette().
| int main | ( | int | argc, |
| char * | argv[] ) |
References THREAD_COUNT, WATCHDOG_TIMEOUT, and wdt_enable_timer().
|
static |
Referenced by russian_roulette().
|
static |
Referenced by test_condition_variable().
|
static |
References ms.
Referenced by test_semaphore().
|
static |
Referenced by test_stop_source().
|
static |
References defer(), and player().
Referenced by test_coroutines().
|
static |
Referenced by test_coroutines().
|
static |
Referenced by assign_lunch_partner().
|
static |
References phase.
|
static |
References run_condition_variable().
|
static |
References russian_roulette(), and select_chamber().
|
static |
|
static |
References assign_lunch_partner(), and thread().
|
static |
References run_semaphore().
|
static |
References counter.
|
static |
References counter, ms, print, and run_stop_source().
|
inlineconstexpr |
Referenced by main().
|
inlineconstexpr |
Referenced by main().