title: Does using ConcurrentDictionary TryGetValue within an if statement make the if contents thread-safe?
body: <p>If I have a ConcurrentDictionary and use the TryGetValue within an if statement, does this make the if statement's contents thread safe? Or must you lock still within the if statement?</p>
  
  <p>Example:</p>
  
  <pre><code>        ConcurrentDictionary&lt;Guid, Client&gt; m_Clients;
  
          Client client;
          //Does this if make the contents within it thread-safe? 
          if (m_Clients.TryGetValue(clientGUID, out client))
          {
              //Users is a list.
              client.Users.Add(item);
          }
  </code></pre>
  
  <p>or do I have to do:</p>
  
  <pre><code>        ConcurrentDictionary&lt;Guid, Client&gt; m_Clients;
  
          Client client;
          //Does this if make the contents within it thread-safe? 
          if (m_Clients.TryGetValue(clientGUID, out client))
          {
              lock (client)
              {
                  //Users is a list.
                  client.Users.Add(item);
              }
          }
  </code></pre>