A
Alex
Dear colleagues
I have a simple function which calls through a function some threads. The
function looks like follow:
Private Sub Refresh( )
Call_ManyOtherThreads_Function(ToDo ) '--> This function creates some
threads
'--> Here I want now to stop the sub until the first call of
Call_ManyOtherThreads_Function( ) is finished.
Call_ManyOtherThreads_Function(ToDo ) '--> This function creates some
threads
End Sub
As you see in the comment, I want to let first finish the first function and
then to call the second function. I tried the following but it doesn't work:
Private Shared mutCon as New Mutex()
Private Sub Refresh( )
mutCon.WaitOne()
Call_ManyOtherThreads_Function( ToDo) ' ---> The last Thread calls the
function mutCon.ReleaseMutex()
'--> Unfortunatelly the Mutex doesn't stop
mutCon.WaitOne()
Call_ManyOtherThreads_Function( ToDo) ' ---> The last Thread calls the
function mutCon.ReleaseMutex()
End Sub
So what am I doing wrong and how can I do this?
Thanks Alex
I have a simple function which calls through a function some threads. The
function looks like follow:
Private Sub Refresh( )
Call_ManyOtherThreads_Function(ToDo ) '--> This function creates some
threads
'--> Here I want now to stop the sub until the first call of
Call_ManyOtherThreads_Function( ) is finished.
Call_ManyOtherThreads_Function(ToDo ) '--> This function creates some
threads
End Sub
As you see in the comment, I want to let first finish the first function and
then to call the second function. I tried the following but it doesn't work:
Private Shared mutCon as New Mutex()
Private Sub Refresh( )
mutCon.WaitOne()
Call_ManyOtherThreads_Function( ToDo) ' ---> The last Thread calls the
function mutCon.ReleaseMutex()
'--> Unfortunatelly the Mutex doesn't stop
mutCon.WaitOne()
Call_ManyOtherThreads_Function( ToDo) ' ---> The last Thread calls the
function mutCon.ReleaseMutex()
End Sub
So what am I doing wrong and how can I do this?
Thanks Alex