TsList: fix race in 'validate'

GitOrigin-RevId: 8006f9f6861557d9232008bc4dd6bb78f2173e3a
This commit is contained in:
Arseny Smirnov 2020-07-24 12:32:27 +03:00
parent 66cc19375a
commit 2b52849b70

View File

@ -69,8 +69,12 @@ class TsListNode : protected ListNode {
} }
void validate() { void validate() {
CHECK(empty() || !ListNode::empty() || is_root); if (empty()) {
CHECK(!empty() || ListNode::empty()); CHECK(ListNode::empty());
} else {
auto guard = lock();
CHECK(!ListNode::empty() || is_root);
}
} }
void remove() { void remove() {