Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make version counter in mlist_t volatile
The log manager is the only one that uses the mlist_t versioned list. The
counter that keeps track of the version number was not modified using
atomic operations meaning that the compiler is free to optimize away parts
of the lock-free versioning mechanism that uses it.

To prevent this optimization, the variable is declared volatile. A rewrite
is direly needed but it cannot be done in 2.2.
  • Loading branch information
markus456 committed Jul 5, 2018
1 parent f511020 commit 33fa9b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/core/internal/mlist.h
Expand Up @@ -32,7 +32,7 @@ typedef struct mlist_st
bool mlist_deleted;
size_t mlist_nodecount;
size_t mlist_nodecount_max; /**< size limit. 0 == no limit */
size_t mlist_versno;
volatile size_t mlist_versno;
bool mlist_flat;
mlist_node_t* mlist_first;
mlist_node_t* mlist_last;
Expand Down

0 comments on commit 33fa9b2

Please sign in to comment.