C++ Library Extensions 2022.12.09
To help learn modern C++ programming
threads Struct Reference

Classes

struct  register_thread
 

Public Types

using id_t = int
 
using handle_t = HANDLE
 
using id_handle_t = std::pair< id_t, handle_t >
 
using active_threads_t = std::map< id_t, handle_t >
 
using mutex_t = std::mutex
 
using recursive_mutex_t = std::recursive_mutex
 
using lock_guard_t = std::lock_guard< mutex_t >
 
using unique_lock_t = std::unique_lock< mutex_t >
 

Static Public Member Functions

static void WINAPI apc_wakeup (ULONG_PTR dwParam)
 
static void register_me (int worker_id)
 
static void unregister_me (int worker_id)
 
static void WINAPI worker (int my_id)
 

Static Public Attributes

static mutex_t mutex
 
static std::condition_variable cv_register
 
static std::condition_variable cv_unregister
 
static std::atomic< int > kill_id {-1}
 
static active_threads_t active_threads
 

Detailed Description

Definition at line 8 of file 023-wakeup.cpp.

Member Typedef Documentation

◆ active_threads_t

Definition at line 14 of file 023-wakeup.cpp.

◆ handle_t

using threads::handle_t = HANDLE

Definition at line 11 of file 023-wakeup.cpp.

◆ id_handle_t

using threads::id_handle_t = std::pair<id_t, handle_t>

Definition at line 13 of file 023-wakeup.cpp.

◆ id_t

using threads::id_t = int

Definition at line 10 of file 023-wakeup.cpp.

◆ lock_guard_t

using threads::lock_guard_t = std::lock_guard<mutex_t>

Definition at line 21 of file 023-wakeup.cpp.

◆ mutex_t

Definition at line 16 of file 023-wakeup.cpp.

◆ recursive_mutex_t

using threads::recursive_mutex_t = std::recursive_mutex

Definition at line 17 of file 023-wakeup.cpp.

◆ unique_lock_t

using threads::unique_lock_t = std::unique_lock<mutex_t>

Definition at line 22 of file 023-wakeup.cpp.

Member Function Documentation

◆ apc_wakeup()

static void WINAPI threads::apc_wakeup ( ULONG_PTR  dwParam)
inlinestatic

Definition at line 30 of file 023-wakeup.cpp.

Here is the caller graph for this function:

◆ register_me()

static void threads::register_me ( int  worker_id)
inlinestatic

Definition at line 36 of file 023-wakeup.cpp.

Here is the caller graph for this function:

◆ unregister_me()

static void threads::unregister_me ( int  worker_id)
inlinestatic

Definition at line 41 of file 023-wakeup.cpp.

Here is the caller graph for this function:

◆ worker()

static void WINAPI threads::worker ( int  my_id)
inlinestatic

Definition at line 68 of file 023-wakeup.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ active_threads

active_threads_t threads::active_threads
inlinestatic

Definition at line 28 of file 023-wakeup.cpp.

◆ cv_register

std::condition_variable threads::cv_register
inlinestatic

Definition at line 24 of file 023-wakeup.cpp.

◆ cv_unregister

std::condition_variable threads::cv_unregister
inlinestatic

Definition at line 25 of file 023-wakeup.cpp.

◆ kill_id

std::atomic<int> threads::kill_id {-1}
inlinestatic

Definition at line 27 of file 023-wakeup.cpp.

◆ mutex

mutex_t threads::mutex
inlinestatic

Definition at line 19 of file 023-wakeup.cpp.


The documentation for this struct was generated from the following file: