remove shared counter

This commit is contained in:
Robin Müller 2022-10-05 11:47:24 +02:00
parent a5979db553
commit a839c7dc3e
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 6 additions and 4 deletions

View File

@ -2,8 +2,6 @@
using namespace std;
static uint32_t SHARED_COUNTER = 0;
int main() {
cout << "Hello World" << endl;
}

View File

@ -2,8 +2,6 @@
using namespace std;
static uint32_t SHARED_COUNTER = 0;
int main() {
cout << "Hello World" << endl;
}

View File

@ -23,3 +23,9 @@ if you are completely new to concurrency in C++.
is protected by a [`std::mutex`](https://en.cppreference.com/w/cpp/thread/mutex).
You can also use the [`std::lock_guard`](https://en.cppreference.com/w/cpp/thread/lock_guard)
which is a [RAII-style](https://en.cppreference.com/w/cpp/language/raii) helper object.
# 2. Using messages
C++ does not really have an built-in message queue implementation.
We are going to use a `std::queue` in conjunction with a `std::mutex` to
have something similar to a message queue API.