/// <summary>
        /// Called when one of the worker threads completes its work.
        /// </summary>
        /// <param name="sender">The event sender.</param>
        /// <param name="e">The event arguments.</param>
        private void StyleCopThreadCompleted(object sender, StyleCopThreadCompletedEventArgs e)
        {
            Param.Ignore(sender);
            Param.AssertNotNull(e, "e");

            // Get the data object.
            Debug.Assert(e.Data != null, "The thread data object should not be null.");

            lock (this)
            {
                // Decrement the thread count.
                if (e.Data.DecrementThreadCount() == 0)
                {
                    // Release the master thread, which is currently waiting for all the workers to complete.
                    Monitor.Pulse(this);
                }
            }
        }
 private void StyleCopThreadCompleted(object sender, StyleCopThreadCompletedEventArgs e)
 {
     lock (this)
     {
         if (e.Data.DecrementThreadCount() == 0)
         {
             Monitor.Pulse(this);
         }
     }
 }