Skip to content
This repository was archived by the owner on Apr 6, 2019. It is now read-only.

Commit afab959

Browse files
committed
update README example with volatile std::atomic_bool
1 parent 21ccd49 commit afab959

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Reply callback is an `std::function<void(reply&)>`.
6767
#include <signal.h>
6868
#include <iostream>
6969

70-
bool should_exit = false;
70+
volatile std::atomic_bool should_exit(false);
7171
cpp_redis::redis_client client;
7272

7373
void
@@ -138,7 +138,7 @@ Unsubscribe from the given pattern.
138138
#include <signal.h>
139139
#include <iostream>
140140
141-
bool should_exit = false;
141+
volatile std::atomic_bool should_exit(false);
142142
cpp_redis::redis_subscriber sub;
143143
144144
void

0 commit comments

Comments
 (0)