Difference between revisions of "Xojo.Threading.CriticalSection.TryEnter"

From Xojo Documentation

(Created page with "{{MethodBox | name = TryEnter | ownertype = class | scope = public | parameters = | owner = ParXojo.Threading.CriticalSectionent | returntype = Boolean }} {{Descripti...")
 
m
 
Line 4: Line 4:
 
| scope = public
 
| scope = public
 
| parameters =  
 
| parameters =  
| owner = [[ParXojo.Threading.CriticalSectionent]]
+
| owner = [[Xojo.Threading.CriticalSection]]
 
| returntype = [[Boolean]]
 
| returntype = [[Boolean]]
 
}}
 
}}

Latest revision as of 18:31, 29 August 2018

Method

Xojo.Threading.CriticalSection.TryEnter() As Boolean

Supported for all project types and targets.

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

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.