Bug 5656 - Application.Lock() does not acquire lock
Summary: Application.Lock() does not acquire lock
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Web (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-06-14 14:26 UTC by Frank Cohen
Modified: 2012-06-14 17:22 UTC (History)
3 users (show)

See Also:
Tags:
Is this bug a regression?: ---
Last known good build:


Attachments

Description Frank Cohen 2012-06-14 14:26:43 UTC
I am trying to run DotNetOpenAuth under Mono 2.10.  I am running it in a .NET MVC2 application.

The original code looks like this:

context.Application.Lock();

                    try
                    {
                        if ((store = (IRelyingPartyApplicationStore)context.Application[ApplicationStoreKey]) == null)
                        {
                            context.Application[ApplicationStoreKey] = store = new StandardRelyingPartyApplicationStore();
                        }
                    }
                    finally
                    {
                        context.Application.UnLock();
                    }



when the code hits the finally block, I get an exception which indicates the lock was never acquired:

System.Threading.SynchronizationLockException: The current thread has not entered the lock in read mode
  at System.Threading.ReaderWriterLockSlim.ExitReadLock () [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplicationState.Get (System.String name) [0x00000] in <filename unknown>:0 
  at System.Web.HttpApplicationState.get_Item (System.String name) [0x00000] in <filename unknown>:0 
  at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty.get_HttpApplicationStore () [0x00000] in <filename unknown>:0 
  at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty..ctor () [0x00000] in <filename unknown>:0

I have modified the code to remove the code to context.Application.Lock()

There are other users who have experienced the same thing, so it seems:

http://www.mojoportal.com/Forums/Thread.aspx?pageid=5&mid=34&ItemID=3&thread=7946&pagenumber=1

http://www.mail-archive.com/mono-bugs@lists.ximian.com/msg82688.html

http://mono.1490590.n4.nabble.com/issue-with-Application-Lock-td3327729.html
Comment 1 Zoltan Varga 2012-06-14 17:22:13 UTC
-> sys.web.

Note You need to log in before you can comment on or make changes to this bug.