Export (0) Print
Expand All

Trace.UseGlobalLock Property

Note: This property is new in the .NET Framework version 2.0.

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)

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:

<configuration>
  <system.diagnostics>
    <trace useGlobalLock="false" />
  </system.diagnostics>

</configuration>

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft