Closed 9MW closed 4 years ago
find
only guarantees that val
is valid in the functor and give no warranties about its fields. In multi-thread environment you should manage val
fields yourself.
This applies to any container in libcds.
try to add some lock
solved by while(true){ if(vx!=NULL){dosomething()} }
When use find function the value pointer occasionally return null,but when inspect it value it's isn't null. like
if (posmap.find(xel, [&](PosHash::value_type& val) { const var& vx = val.second; if(vx==NULL){ vx->insert(cdid); } val.second->insert(cdid); }))
when vx==NULL reinsert still get success.