I am Using same function from many places…
for example below function
Public Sub getUser(ByVal Name as string)
dim myName=Name
.......
insert(myName)
End Sub
I am using this function from so many places…
I have doubt should this function override this myName values with latest function call?
Suppose i called getUser(“ABC”) so value of myName is now ABC now sudden all call getUser(“XYZ”) so at insert(myName) will it insert(“ABC”) or insert(“XYZ”)??
I need it to be insert(“ABC”) and then insert(“XYZ”)
You can use locking to make sure only one thread does something at a time
With the locking, now only one thread will be able to execute the code between
SyncLock and End SyncLockthis means FirstABCwill be inserted and thenXYZwill be inserted