Skip to content

Commit 3c2554e

Browse files
author
Artiom N.
committed
Global variables for the handler must be volatile
1 parent 627753d commit 3c2554e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/book01/ch06/cpp/oob_example/oob_server_async.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extern "C"
2020

2121

2222
constexpr size_t buffer_size = 255;
23-
std::atomic<bool> oob_flag = false;
23+
volatile std::atomic<bool> oob_flag = false;
2424

2525

2626
void signal_handler(int signal)

0 commit comments

Comments
 (0)