Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using Mutex class
Message
 
À
18/06/2007 17:39:19
Timothy Bryan
Sharpline Consultants
Conroe, Texas, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Divers
Thread ID:
01234134
Message ID:
01234202
Vues:
10
Hi Tim,

>I am need of limiting access to some methods in a class to a single case.

Wouldn't lock work?
class sample
{
  Object myLock = new Object();
  public void DoSomething()
  {
    lock(myLock) 
    {
       // do something here
    }
  }
}
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform