This repository was archived by the owner on Mar 22, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
include/libpmemobj++/container
tests/concurrent_hash_map_tx Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -2870,10 +2870,13 @@ class concurrent_hash_map
28702870
28712871 bool is_initial = this ->size () == 0 ;
28722872
2873+ pool_base pop = get_pool_base ();
2874+ pmem::obj::transaction::manual tx (pop);
28732875 for (size_type m = mask (); buckets > m; m = mask ())
28742876 enable_segment (
28752877 segment_traits_t::segment_index_of (m + 1 ),
28762878 is_initial);
2879+ pmem::obj::transaction::commit ();
28772880 }
28782881
28792882 /* *
Original file line number Diff line number Diff line change @@ -276,6 +276,19 @@ test_tx_singlethread(nvobj::pool<root> &pop)
276276 UT_ASSERTeq (bucket_count, map->bucket_count ());
277277 verify_elements (pop, number_of_inserts);
278278
279+ /* try {
280+ pmem::obj::transaction::run(pop, [&] {
281+ map->reserve(10 * (size_t)number_of_inserts);
282+ pmem::obj::transaction::abort(0);
283+ });
284+ } catch (pmem::manual_tx_abort &) {
285+ } catch (std::exception &e) {
286+ UT_FATALexc(e);
287+ }
288+
289+ UT_ASSERTeq(bucket_count, map->bucket_count());
290+ verify_elements(pop, number_of_inserts); */
291+
279292 try {
280293 pmem::obj::transaction::run (pop, [&] {
281294 pmem::obj::delete_persistent<persistent_map_type>(map);
You can’t perform that action at this time.
0 commit comments