title: How to get thread Id in C#
body: <pre><code>public bool HasItemsFromPropertySet(InfoItemPropertySet propertySet, CompositeInfoItem itemRemoved)
      {
          var itemAndSubItems = new InfoItemCollection();
          if (itemRemoved != null)
          {
              itemAndSubItems.Add(itemRemoved);
              //foreach (InfoItem item in itemRemoved.AllDescendants)
              itemAndSubItems.AddRange(itemRemoved.AllDescendants);
          }
          return AllItems.AsParallel().Any(item =&gt; item.PropertySet == propertySet &amp;&amp; !itemAndSubItems.Contains(item));
      }
  </code></pre>
  
  <p><br>Above in my code I use AsParallel().Any()
  How can i get thread ID of thread generated by that AsParellel.Any()...</p>