bucket accessor is to find, rehash, acquire a lock, and access a bucket
#include <concurrent_hash_map.h>

Public Member Functions | |
| void | acquire (concurrent_hash_map *base, const hashcode_t h, bool writer=false) |
| find a bucket by masked hashcode, optionally rehash, and acquire the lock | |
| bucket_accessor (concurrent_hash_map *base, const hashcode_t h, bool writer=false) | |
| bool | is_writer () |
| check whether bucket is locked for write | |
| bucket * | operator() () |
| get bucket pointer | |
| bool | upgrade_to_writer () |
Definition at line 630 of file concurrent_hash_map.h.
| tbb::interface4::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_accessor::bucket_accessor | ( | concurrent_hash_map * | base, | |
| const hashcode_t | h, | |||
| bool | writer = false | |||
| ) | [inline] |
Definition at line 634 of file concurrent_hash_map.h.
: public bucket::scoped_t {
| void tbb::interface4::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_accessor::acquire | ( | concurrent_hash_map * | base, | |
| const hashcode_t | h, | |||
| bool | writer = false | |||
| ) | [inline] |
Definition at line 636 of file concurrent_hash_map.h.
References tbb::acquire.
:
bucket_accessor( concurrent_hash_map *base, const hashcode_t h, bool writer = false ) { acquire( base, h, writer ); }
inline void acquire( concurrent_hash_map *base, const hashcode_t h, bool writer = false ) {
my_b = base->get_bucket( h );
#if TBB_USE_THREADING_TOOLS
// TODO: actually, notification is unnecessary here, just hiding double-check
if( itt_load_pointer_with_acquire_v3(&my_b->node_list) == internal::rehash_req
#else
if( __TBB_load_with_acquire(my_b->node_list) == internal::rehash_req
#endif
&& try_acquire( my_b->mutex, /*write=*/true ) )
{
if( my_b->node_list == internal::rehash_req ) base->rehash_bucket( my_b, h ); //recursive rehashing
my_is_writer = true;
| bool tbb::interface4::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_accessor::is_writer | ( | ) | [inline] |
Definition at line 653 of file concurrent_hash_map.h.
Referenced by tbb::interface4::concurrent_hash_map< Key, T, HashCompare, Allocator >::lookup().
| bucket* tbb::interface4::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_accessor::operator() | ( | ) | [inline] |
Definition at line 655 of file concurrent_hash_map.h.
{ return my_is_writer; }
| bool tbb::interface4::concurrent_hash_map< Key, T, HashCompare, Allocator >::bucket_accessor::upgrade_to_writer | ( | ) | [inline] |
Definition at line 657 of file concurrent_hash_map.h.
Referenced by tbb::interface4::concurrent_hash_map< Key, T, HashCompare, Allocator >::lookup().
{ return my_is_writer; }
Copyright © 2005-2010 Intel Corporation. All Rights Reserved.
Licensed under the GNU General Public License 2 with the runtime exception.
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
* Other names and brands may be claimed as the property of others.