Skip to content

Commit 69b5a77

Browse files
committed
Modify MUTEX usage/handling
1 parent 3cd1ee1 commit 69b5a77

File tree

7 files changed

+4
-137
lines changed

7 files changed

+4
-137
lines changed

Software/OpenAstroTracker ASCOM/OAT PC Control/bin/Debug/OpenAstroTracker_PCControl.exe.config

Lines changed: 0 additions & 18 deletions
This file was deleted.

Software/OpenAstroTracker ASCOM/OAT PC Control/bin/Debug/OpenAstroTracker_PCControl.vshost.exe.config

Lines changed: 0 additions & 18 deletions
This file was deleted.

Software/OpenAstroTracker ASCOM/OAT PC Control/bin/Debug/OpenAstroTracker_PCControl.vshost.exe.manifest

Lines changed: 0 additions & 48 deletions
This file was deleted.

Software/OpenAstroTracker ASCOM/OAT PC Control/bin/Debug/OpenAstroTracker_PCControl.xml

Lines changed: 0 additions & 48 deletions
This file was deleted.

Software/OpenAstroTracker ASCOM/OpenAstroTracker ASCOM/Driver.vb

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ Public Class Telescope
102102
astroUtilities = New AstroUtils 'Initialise new astro utiliites object
103103

104104
'TODO: Implement your additional construction here
105-
105+
mutexCommand = New Mutex(False, "CommMutex")
106106
TL.LogMessage("Telescope", "Completed initialisation")
107107
End Sub
108108

@@ -160,8 +160,8 @@ Public Class Telescope
160160

161161
Public Sub CommandBlind(ByVal Command As String, Optional ByVal Raw As Boolean = False) Implements ITelescopeV3.CommandBlind
162162
CheckConnected("CommandBlind")
163-
mutexBlind = New Mutex(False, "CommMutex")
164-
mutexBlind.WaitOne()
163+
mutexCommand.WaitOne()
164+
165165
If Not Raw Then
166166
Command = Command + "#"
167167
End If
@@ -171,7 +171,7 @@ Public Class Telescope
171171
Catch ex As Exception
172172
TL.LogMessage("CommandBlind(" + Command + ")", "Error : " + ex.Message)
173173
Finally
174-
mutexBlind.ReleaseMutex()
174+
mutexCommand.ReleaseMutex()
175175
End Try
176176
End Sub
177177

@@ -188,7 +188,6 @@ Public Class Telescope
188188
Implements ITelescopeV3.CommandString
189189
Dim response As String
190190
CheckConnected("CommandString")
191-
mutexCommand = New Mutex(False, "CommMutex")
192191
mutexCommand.WaitOne()
193192
If Not Raw Then
194193
Command = Command + "#"

0 commit comments

Comments
 (0)