src/openSourceC.DotNetLibrary.Windows/ServiceProcess/ServiceApplicationBase.cs
/// <summary>
///		Blocks the current thread until the current instance obtains the single use lock,
///		using a 32-bit signed integer to specify the time interval.
/// </summary>
/// <returns>
///		<b>true</b> if successful; otherwise, <b>false</b>.
/// </returns>
Blocks the current thread until the current instance obtains the single use lock,
using a 32-bit signed integer to specify the time interval.
Blocks the current thread until the current instance obtains the single use lock using a 32 - bit signed integer to specify the time interval .
public bool SingleUseLockWaitOne(int millisecondsTimeout)
		{
			if (_singleUse == null)
			{
				lock (_singleUseLock)
				{
					if (_singleUse == null)
					{
						Type type = GetType();
						string singleUseObjectName = string.Format(@"Global\{0}: {1}, {2}", ServiceName, type.FullName, type.Assembly.GetName().Name);
						_singleUse = new Semaphore(1, 1, singleUseObjectName);
					}
				}
			}
			return _singleUse.WaitOne(millisecondsTimeout);
		}
public bool SingleUseLockWaitOne ( int millisecondsTimeout ) { if ( _singleUse == null ) { lock ( _singleUseLock ) { if ( _singleUse == null ) { Type type = GetType ( ) ; string singleUseObjectName = string . Format ( @"Global\{0}: {1}, {2}" , ServiceName , type . FullName , type . Assembly . GetName ( ) . Name ) ; _singleUse = new Semaphore ( 1 , 1 , singleUseObjectName ) ; } } } return _singleUse . WaitOne ( millisecondsTimeout ) ; }
Blocks the current thread until the current instance obtains the single use lock,
using a 32-bit signed integer to specify the time interval.
Blocks the current thread until the current instance obtains the single use lock using a 32 - bit signed integer to specify the time interval .
// ServiceName is set after the constructor is executed.
None
millisecondsTimeout
int