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 @@ -2875,10 +2875,13 @@ class concurrent_hash_map
28752875
28762876 bool is_initial = this ->size () == 0 ;
28772877
2878+ pool_base pop = get_pool_base ();
2879+ pmem::obj::transaction::manual tx (pop);
28782880 for (size_type m = mask (); buckets > m; m = mask ())
28792881 enable_segment (
28802882 segment_traits_t::segment_index_of (m + 1 ),
28812883 is_initial);
2884+ pmem::obj::transaction::commit ();
28822885 }
28832886
28842887 /* *
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