コード例 #1
0
        /// <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);
        }
コード例 #2
0
 /// <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;
 }