/// <summary>
        /// Acquires the lock.
        /// </summary>
        /// <param name="syncObject">The sync object.</param>
        /// <returns></returns>
        public static AutoCS AcquireLock(ICriticalSection syncObject)
        {
            AutoCS cs = new AutoCS(syncObject);

            cs._syncObject.Enter();
            return(cs);
        }
 /// <summary>
 /// Acquires the lock.
 /// </summary>
 /// <param name="syncObject">The sync object.</param>
 /// <returns></returns>
 public static AutoCS AcquireLock(ICriticalSection syncObject)
 {
     AutoCS cs = new AutoCS(syncObject);
     cs._syncObject.Enter();
     return cs;
 }