[Mono-dev] lock source

alcherenga alcherenga alcherenga at gmail.com
Wed Apr 23 10:57:07 EDT 2008


Hi Robert,
I know that lock eventually translates to monitor.enter and monitor.exit. i
did saw the file you have mentioned , what really i am looking for wherein ,
i mean in which the "syntatic sugar" get's converted to "monitor .enter
....".
i mean where is the keyword defined .
thanks
alcherenga


On 4/23/08, Robert Jordan <robertj at gmx.net> wrote:
>
> alcherenga alcherenga wrote:
> > hi,
> > could anyone tell me wherein the c# lock statment is being elemented. I
> mean
> > the source file.
> > i couldn't find it in mscorlib/system.threading folder.
>
> The C# block:
>
>        lock (foo) {
>                ...
>        }
>
> is just syntactic sugar for this:
>
>        System.Threading.Monitor.Enter (foo);
>        try {
>                ...
>
>        } finally {
>                System.Threading.Monitor.Leave (foo);
>        }
>
> So you're looking for the class System.Threading.Monitor.
>
> Since you'll find interesting stuff in this file, the next
> answer will be mono/mono/metadata/monitor.c ;-)
>
> Robert
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080423/700708ff/attachment.html 


More information about the Mono-devel-list mailing list