Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 libpmemobj-cpp (1.8-1) unstable; urgency=medium
 .
   * Upstream release.
Author: Adam Borowski <kilobyte@angband.pl>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2019-10-14

--- libpmemobj-cpp-1.8.orig/include/libpmemobj++/container/concurrent_hash_map.hpp
+++ libpmemobj-cpp-1.8/include/libpmemobj++/container/concurrent_hash_map.hpp
@@ -1125,6 +1125,9 @@ public:
 		hashcode_type m_now, m_old = m;
 
 		m_now = mask().load(std::memory_order_acquire);
+#if LIBPMEMOBJ_CPP_VG_HELGRIND_ENABLED
+		ANNOTATE_HAPPENS_AFTER(&(this->my_mask));
+#endif
 
 		if (m_old != m_now)
 			return check_rehashing_collision(h, m_old, m = m_now);
@@ -2696,6 +2699,9 @@ concurrent_hash_map<Key, T, Hash, KeyEqu
 		std::this_thread::yield();
 
 		m = mask().load(std::memory_order_acquire);
+#if LIBPMEMOBJ_CPP_VG_HELGRIND_ENABLED
+		ANNOTATE_HAPPENS_AFTER(&(this->my_mask));
+#endif
 	}
 
 	if (result) {
@@ -2764,6 +2770,9 @@ concurrent_hash_map<Key, T, Hash, KeyEqu
 		std::this_thread::yield();
 
 		m = mask().load(std::memory_order_acquire);
+#if LIBPMEMOBJ_CPP_VG_HELGRIND_ENABLED
+		ANNOTATE_HAPPENS_AFTER(&(this->my_mask));
+#endif
 	}
 
 	if (result) {
@@ -2786,6 +2795,10 @@ concurrent_hash_map<Key, T, Hash, KeyEqu
 	node_ptr_t n;
 	hashcode_type const h = hasher{}(key);
 	hashcode_type m = mask().load(std::memory_order_acquire);
+#if LIBPMEMOBJ_CPP_VG_HELGRIND_ENABLED
+	ANNOTATE_HAPPENS_AFTER(&(this->my_mask));
+#endif
+
 	pool_base pop = get_pool_base();
 
 restart : {
