gotten rid of wait_for_epochs in insertion

This commit is contained in:
joaquintides
2023-12-04 11:26:35 +01:00
parent d6a8a4462c
commit 8bd1bcf5de

View File

@@ -1492,7 +1492,7 @@ private:
for(;;){ for(;;){
startover: startover:
boost::uint32_t counter=insert_counter(pos0); boost::uint32_t counter=++insert_counter(pos0);
if(unprotected_visit( if(unprotected_visit(
access_mode,k,pos0,hash,std::forward<F>(f)))return 0; access_mode,k,pos0,hash,std::forward<F>(f)))return 0;
@@ -1510,8 +1510,8 @@ private:
/* slot wasn't empty */ /* slot wasn't empty */
goto startover; goto startover;
} }
wait_for_epochs(); // WHY BEFORE THE FOLLOWING? auto lck=access(group_exclusive{},pos0);
if(BOOST_UNLIKELY(insert_counter(pos0)++!=counter)){ if(BOOST_UNLIKELY(insert_counter(pos0)!=counter)){
/* other thread inserted from pos0, need to start over */ /* other thread inserted from pos0, need to start over */
pg->reset(n); pg->reset(n);
goto startover; goto startover;