Re: lock used in thread and by event




Hello, I can't post the program but code was in previous posting.
But what I would like to know is that is event call executed in caller
thread's context or
in the context of that thread were the event handler code is? To
clearify: is event call
same as a method call and executed in context of the thread which has
the actual event handler?

So, is my example of two different threads using event and same lock-
variable in first thread
same thing that what happends when one thead calls lock(this) too
times sequentially (and it does
not start waitiing in second lock call).

Cheers!




On 25 syys, 14:18, Jon Skeet [C# MVP] <sk...@xxxxxxxxx> wrote:
<uupi_...@xxxxxxxxx> wrote:

<snip>

What I have noticed that lock(_myList) does not stop and start waiting
if one of the threads have aquired it.

It will do if it's a different thread.

lock(_myList) goes allways through. So, can anyone explain that is
Event call same as a call executed in thread that owns lock(_myList)
or how this goes?

Can anyone clarify this to me?
Any documentation considering this issue?

Could you post a short but complete program which demonstrates the
problem?

Seehttp://www.pobox.com/~skeet/csharp/complete.htmlfor details of
what I mean by that.

--
Jon Skeet - <sk...@xxxxxxxxx>http://www.pobox.com/~skeet Blog:http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too


.



Relevant Pages

  • Re: Hines-Renfors-Johansson-McCulloch team of scientific experts explain Vinland Map ink
    ... <Stupid top posting cow's top posting healed> ... > more when taken out of it's context. ... The logical conclusion of this is that no assertion as to a fact can ... But then you are a stupid, dumb, lying, top posting cow aren't you ...
    (sci.archaeology)
  • Re: OT--(was: Taking on city hall) Top Posting
    ... > folks to delete everything not necessary to keep the new post in context. ... For this reason I spent my time to write that long posting - to give the ... For Usenet there is RFC 1855 which describes how people should ...
    (rec.crafts.metalworking)
  • Re: ActiveX TreeCtrl ContextMenu
    ... Hui Song ... To begin Create a context menu with the Menu Editor ... global MouseX ... You need to use an event handler on the ActiveX object. ...
    (comp.soft-sys.matlab)
  • top/bottom posting (was: Re: Please help Me!!)
    ... Here is my preferred method of replying. ... in a "bottom posting" method. ... (for context or whatever), I could scroll down. ...
    (rec.autos.sport.nascar)
  • Re: ActiveX TreeCtrl ContextMenu
    ... To begin Create a context menu with the Menu Editor ... global MouseX ... global MouseY ... You need to use an event handler on the ActiveX object. ...
    (comp.soft-sys.matlab)

Loading