Parallele Fäden und bedingte Variablen

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Parallele Fäden und bedingte Variablen

by Anonymous » 10 Apr 2025, 00:37

Ich bin ein bisschen verwirrt mit dem offiziellen Beispiel für eine bedingte Variable in C ++.#include
#include
#include
#include

std::condition_variable cv;
std::mutex cv_m; // This mutex is used for three purposes:
// 1) to synchronize accesses to i
// 2) to synchronize accesses to std::cerr
// 3) for the condition variable cv
int i = 0;

void waits()
{
std::unique_lock lk(cv_m);
std::cerr

Top