Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8065373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T11:39:07+00:00 2026-06-05T11:39:07+00:00

I am using DotNetOpenAuth in conjunction with Mono 2.10. When context.Application.Unlock() is called, an

  • 0

I am using DotNetOpenAuth in conjunction with Mono 2.10. When context.Application.Unlock() is called, an exception is thrown indicating the lock was never acquired in the first place. I’ve modified the code as shown below.

My question is, does the code serve the same purpose, and does mono under Apache even support locking in this way?

Original

                   context.Application.Lock();

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

My Modifications

 lock (app)
                {

                    try
                    {
                        if ((store = (IRelyingPartyApplicationStore)context.Application[ApplicationStoreKey]) == null)
                        {
                            context.Application[ApplicationStoreKey] = store = new StandardRelyingPartyApplicationStore();
                        }
                    }
                    finally
                    {
                        //context.Application.UnLock();
                    }
                }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T11:39:08+00:00Added an answer on June 5, 2026 at 11:39 am

    Actually is not the same think the Application.Lock(); with the lock(app)

    The Application.Lock(); is lock all threads on pools, the lock(app) can lock only current pool threads.

    If you have problems with the Application data, then save them in a static variable and there you can use the lock(), and its faster and suggested by microsoft.

    for more details read also this similar answer: https://stackoverflow.com/a/10964038/159270

    By the way this is the code of the Application.Lock();

    public void Lock()
    {
        this._lock.AcquireWrite();
    }
    
    internal virtual void AcquireWrite()
    {
        lock (this)
        {
            while (this._lock != 0)
            {
                try
                {
                    Monitor.Wait(this);
                    continue;
                }
                catch (ThreadInterruptedException)
                {
                    continue;
                }
            }
            this._lock = -1;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using DotNetOpenAuth to integrate openID in our web application. The code below
Myself implementented SSO in my application using Authentication Exchange in c# by Dotnetopenauth My
I'm using DotNetOpenAuth. I configured my application with Custom form authentication with Gmail OpenID
I have been using DotNetOpenAuth v3.5.0.10357 for about a year now and finally decided
I am using DotNetOpenAuth in my ASP.Net Website. I have modified it to work
I'm using DotNetOpenAuth lib to work with Google(only) OpenId. And I'm retrieving Email without
I am running an issue with google openid identifier. I am using dotnetopenauth library
Introduction We have an OpenID Provider which we created using the DotNetOpenAuth component. Everything
I'm using the sample provider and relying party applications that come in the DotNetOpenAuth
Using DotNetOpenAuth 3.4.3.10103 when i call: public static XDocument GetUpdates(ConsumerBase twitter, string accessToken) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.