title: Why can't I have two accessors for the same element in tbb hash map?
body: <p>In the below code, if I do not release <code>a1</code> the code seems to be stuck in an infinite loop inside the <code>map.find</code> function. </p>
  
  <p>What if I need to search for an element in two different parts of the application? </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include "tbb/concurrent_hash_map.h"
  
  using namespace std;
  using namespace tbb;
  
  void main()
  {
      concurrent_hash_map&lt;int, int&gt; map; 
  
      concurrent_hash_map&lt;int, int&gt;::accessor a1, a2; 
  
      map.insert(make_pair(1, 111));
  
      cout &lt;&lt; "a1 - " &lt;&lt; map.find(a1, 1) &lt;&lt; endl; 
  
      //a1.release();
  
      cout &lt;&lt; "a2 - " &lt;&lt; map.find(a2, 1) &lt;&lt; endl;
  }
  </code></pre>