NeuralJack
Centurion
- Joined
- Jul 28, 2005
- Messages
- 138
I usually work with many threads. But more often than not I do not want those threads to hit the same routine at the same time. Currently here's what I do. If any of you have a more effective/efficient way let me know. For all i know VB has some sort of property a subroutine can have that only allows it to be accessed by one thread at a time.
Visual Basic:
Public RoutineIsRunning As Boolean = False
Public Sub RoutineOfInterest()
If RoutineIsRunning = False Then
RoutineIsRunning = True
'
' The Code for this routine
'
RoutineIsRunning = False
End If
End Sub