Trace.UseGlobalLock Property

Gets or sets a value indicating whether the global lock should be used.

Namespace: System.Diagnostics
Assembly: System (in system.dll)

public static bool UseGlobalLock { get; set; }
/** @property */
public static boolean get_UseGlobalLock ()

/** @property */
public static void set_UseGlobalLock (boolean value)

public static function get UseGlobalLock () : boolean

public static function set UseGlobalLock (value : boolean)

Not applicable.

Property Value

true if the global lock is to be used; otherwise, false. The default is true.

The global lock is always used if the trace listener is not thread safe, regardless of the value of UseGlobalLock. The IsThreadSafe property is used to determine if the listener is thread safe. The global lock is not used only if the value of UseGlobalLock is false and the value of IsThreadSafe is true. The default behavior is to use the global lock.

To set the UseGlobalLock for Trace, you can also edit the configuration file that corresponds to the name of your application. The configuration file should be formatted like the following example:

    <trace useGlobalLock="false" />

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions