![]() |
C++ Library Extensions 2022.12.09
To help learn modern C++ programming
|
#include <tpf_output.hpp>
#include <future>
#include <thread>
#include <condition_variable>
#include <atomic>
Go to the source code of this file.
Functions | |
void | worker (const char *name, int my_turn) |
void | example_for_synchronization () |
int | main () |
Variables | |
constexpr int | max_count = 12 |
constexpr int | max_players = 3 |
int | whose_turn = 0 |
std::atomic< int > | count {0} |
std::mutex | mutex |
std::condition_variable | condition_variable |
void example_for_synchronization | ( | ) |
Definition at line 55 of file 009-synchronization.cpp.
int main | ( | ) |
void worker | ( | const char * | name, |
int | my_turn | ||
) |
std::condition_variable condition_variable |
Definition at line 14 of file 009-synchronization.cpp.
std::atomic<int> count {0} |
Definition at line 11 of file 009-synchronization.cpp.
|
constexpr |
Definition at line 7 of file 009-synchronization.cpp.
|
constexpr |
Definition at line 8 of file 009-synchronization.cpp.
std::mutex mutex |
Definition at line 13 of file 009-synchronization.cpp.
int whose_turn = 0 |
Definition at line 10 of file 009-synchronization.cpp.