Go Back

Does anyone have a code example of using the @Threading.Mutex() class?

I'm trying to create some logic that will hold a variable in memory and several threads may try and update it.  So, I want to make sure only 1 thread at a time can access the variable and update it, then release the lock on it.  I see in the library I can do the following code below, but I cannot find any documentation on how to use it.  Looking for some code samples on how to use it.
                if (myMutex == ^null)
                    myMutex = new @Threading.Mutex()
 

1 Answer
0   | Posted by Matt Canaday to Synergy .NET on 2/26/2024 10:44 PM
Steve Ives
Hi Matt,
I think what you're looking for is System.Threading.Monitor. Here's an example:

User-added image

Hope it helps.

Steve

2/29/2024 6:10 PM   1  
Please log in to comment or answer this question.