Using The SyncLock Statement

  • Thread starter Thread starter Ken Tucker [MVP]
  • Start date Start date
K

Ken Tucker [MVP]

Hi,

Synclock MyVariableName

End Synclock

Or

SyncLock gettype(MyClass)

End Synclock.


Ken
-----------------------
 
Hey,
I have about 5 Shared variables, that I want to be locked for access when
they are written to.
I'v read in the MSDN about the SyncLock statement, and I'm prety sure that's
what I'm looking for,
But the SycLock statement requires a statement in it's decleration:
SyncLock <Statement>
MySharedMember=NewValue
End SyncLock
What the statement's supposed to be?
Thanks ahead

-- Ram
 
you can use a dummy string var for that

Public ThreadLock As String = "Lock Me"

i use this in a multithreaded app to lock callback routines



this was a tip in Programming visual basic.Net from F. balena

and works fine for me



hth

M.Posseth [MCP]
 
Back
Top