Difference between revisions of "CriticalSection.TryEnter"

From Xojo Documentation

m
m
 
Line 9: Line 9:
 
{{Description
 
{{Description
 
|text = Attempts to get a lock on the resource managed by the '''CriticalSection'''. }}
 
|text = Attempts to get a lock on the resource managed by the '''CriticalSection'''. }}
 +
 +
==Notes==
  
 
TryEnter is similar to Enter but returns a [[Boolean]]. If it succeeds, it returns [[True]] and the thread has exclusive use of the resource. If it fails, it returns [[False]] but does not block execution of the thread.
 
TryEnter is similar to Enter but returns a [[Boolean]]. If it succeeds, it returns [[True]] and the thread has exclusive use of the resource. If it fails, it returns [[False]] but does not block execution of the thread.

Latest revision as of 22:09, 30 January 2012

Method

CriticalSection.TryEnter() As Boolean

Supported for all project types and targets.

Attempts to get a lock on the resource managed by the CriticalSection.

Notes

TryEnter is similar to Enter but returns a Boolean. If it succeeds, it returns True and the thread has exclusive use of the resource. If it fails, it returns False but does not block execution of the thread.