File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -133,8 +133,8 @@ static ENGINE_ERROR_CODE mock_cookie_reserve(const void *cookie) {
133
133
static ENGINE_ERROR_CODE mock_cookie_release (const void *cookie) {
134
134
struct mock_connstruct *c = (struct mock_connstruct *)cookie;
135
135
136
- c->references -- ;
137
- if (c-> references == 0 ) {
136
+ const int new_rc = -- c->references ;
137
+ if (new_rc == 0 ) {
138
138
free (c);
139
139
}
140
140
return ENGINE_SUCCESS;
Original file line number Diff line number Diff line change 4
4
#include < memcached/engine.h>
5
5
#include < platform/platform.h>
6
6
7
+ #include < atomic>
7
8
#include < string>
8
9
9
10
struct mock_connstruct {
@@ -23,7 +24,7 @@ struct mock_connstruct {
23
24
bool handle_datatype_support;
24
25
cb_mutex_t mutex;
25
26
cb_cond_t cond;
26
- int references;
27
+ std::atomic< int > references;
27
28
};
28
29
29
30
struct mock_callbacks {
You can’t perform that action at this time.
0 commit comments