You can see the code at

[link:fsharppowerpack.codeplex.com]

under compiler\2.0\Nov2010\src\fsharp\FSharp.Core\prim-types.fs

I think what you're asking about is

1
2
3
4
5
6
7
8
9
       [<CompiledName("Lock")>]
       let inline lock (lockobj : 'T when 'T : not struct) f  = 
           let mutable lockTaken = false
           try 
               System.Threading.Monitor.Enter(lockobj, &lockTaken);
               f()
           finally
               if lockTaken then
                   System.Threading.Monitor.Exit(lockobj)

maybe?

By on 1/25/2011 12:34 PM ()

Yes the Monitor.Enter overload was added in .Net 4.0 to address lock leaks during exceptions...

By on 1/28/2011 3:03 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper