[Mono-dev] lock source

Rafael Teixeira monoman at gmail.com
Wed Apr 23 14:18:39 EDT 2008


Specifically, look at the .jay file to see the production grammar rule, and
find to what AST classes it relay the job, to see what their emit part
generate.

:)

On Wed, Apr 23, 2008 at 12:24 PM, Robert Jordan <robertj at gmx.net> wrote:

> Hi,
>
> you may want to look at mcs' sources then.
>
> Robert
>
> alcherenga alcherenga wrote:
> > 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
> >>
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Mono-devel-list mailing list
> > Mono-devel-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>



-- 
Rafael "Monoman" Teixeira
---------------------------------------
"I myself am made entirely of flaws, stitched together with good
intentions."
Augusten Burroughs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080423/aea4fd14/attachment.html 


More information about the Mono-devel-list mailing list