Fix race condition in OnDiskInvertedlists. (#464)
parent
28e9f74511
commit
dcd83f95b9
|
@ -164,6 +164,7 @@ struct OnDiskInvertedLists::OngoingPrefetch {
|
|||
static void* prefetch_list (void * arg) {
|
||||
Thread *th = static_cast<Thread*>(arg);
|
||||
|
||||
th->od->locks->lock_1(th->list_no);
|
||||
size_t n = th->od->list_size(th->list_no);
|
||||
const Index::idx_t *idx = th->od->get_ids(th->list_no);
|
||||
const uint8_t *codes = th->od->get_codes(th->list_no);
|
||||
|
@ -177,6 +178,7 @@ struct OnDiskInvertedLists::OngoingPrefetch {
|
|||
for (size_t i = 0; i < n8;i++) {
|
||||
cs += codes8[i];
|
||||
}
|
||||
th->od->locks->unlock_1(th->list_no);
|
||||
global_cs += cs & 1;
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue