I'm working on an old VB legacy application, and I'm sort of struggling to get my bearing of things.
Basically from what I understand this application essentially takes a file, and throws it into an executable, that's pretty much it. The client wants this to be done with multiple threads, however the person that worked on this application before me does not work here anymore.
At some point in an asynchronous there's the offending line of code:
Dim exeProcess As Process
Dim exeInfo As New ProcessStartInfo
' presume that appFile is in the same path as the executable
With exeInfo
.FileName = _AppPath & "\" & _Executable
.Arguments = arg
.UseShellExecute = False
.WorkingDirectory = _WorkingFolder
End With
Dim mutex As Mutex = New Mutex(False, "namedMutex")
mutex.WaitOne()
exeProcess = Process.Start(exeInfo)
_RunningProcess = exeProcess
exeProcess.WaitForExit()
exeProcess.Close()
mutex.ReleaseMutex()
If I comment out the mutex.WaitOne() and mutex.ReleaseMutex() the process it starts throws errors about not being able to create new files. The previous person that worked on this left a comment about how there's synchronization issues, which is why the mutex is necessary.
I don't really have much knowledge of visual basic, and as it stands I'm basically clueless as to what I'm supposed to do. If anybody has any suggestions on what I can do to even approach solving this problem I will be very grateful. I apologize for not providing more information in this post, this is basically what I'm working with. /: