Write&Read Locks

RandomMan
RandomMan
edited June 2017 in Photon Server
Some questions. Firstly see this code:

void HelloWorld
{
    using (WriteLock.TryEnter(readWriteLock, 1000))
    {
        SuperFunc()
    }
}
void SuperFunc()
{
//Something...
}
1.I called function SuperFunc() with WriteLock but how can I remove readlock later?
2.What differents between Read and Write Locks and UpgradeableReadLock?
3.When I should use these locks? For example: for reading list but I should use Read Lock right? And If I read&write I use Write Lock?

Comments

  • Okay one qustion: how to Exit Read or WRite lock? Other questions I already know!
  • hi, RandomMan

    this is done at the end of using block automatically during disposal of internal object

    best,
    ilya