G
Guest
Hello Everyone,
I need to run a peice of code without any interruptionsby other thread.
In other words I want to put a mutual exclusion lock.
There is a method that I need to call within that lock. This method resides
in a class that in turn resides in a classLibrary. How can I call a monitor
or lock method on the class.
So for example I have a class Library called classLibrary1. I have class
inside the callsLibrary1 called Class1. I need to call a method called
getBytes() from class1.
This method getBytes() in turn calls other methods in the same class and
different classes.
How can I put a mutual exclusive lock until I am done calling this method
and get the return value from the getBytes().
I read a microsoft document where it mentions that I can use Lock() method
and Monitor() method to put locks,
but I am not sure how to call a method inside lock method in order to
execute this getBytes() method that resides in a class library.
lock(not sure what to call)
or Monitor(not sure what to call)
Any help will be apprecaited.
Thanks.
I need to run a peice of code without any interruptionsby other thread.
In other words I want to put a mutual exclusion lock.
There is a method that I need to call within that lock. This method resides
in a class that in turn resides in a classLibrary. How can I call a monitor
or lock method on the class.
So for example I have a class Library called classLibrary1. I have class
inside the callsLibrary1 called Class1. I need to call a method called
getBytes() from class1.
This method getBytes() in turn calls other methods in the same class and
different classes.
How can I put a mutual exclusive lock until I am done calling this method
and get the return value from the getBytes().
I read a microsoft document where it mentions that I can use Lock() method
and Monitor() method to put locks,
but I am not sure how to call a method inside lock method in order to
execute this getBytes() method that resides in a class library.
lock(not sure what to call)
or Monitor(not sure what to call)
Any help will be apprecaited.
Thanks.