Skip to content

Exception in ReaderWriterLock

George George

Asked Apr 17, 2008, 3:50 AM EDT4 answers
Share
LinkedInX

Hello everyone,


Two questions about exceptions from ReaderWriterLock class,

1. If I use parameter -1 (no timeout value) to acquire either read or write lock, is there any possibility there will be any exceptions?

2. When we release the lock, if the current thread is the owner, is there any possibility to throw any exceptions?


thanks in advance,
George

4 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • 0
    I am not familiar with the ReaderWriterLock, but I can imagine what it does. According to this there is an exception that can be thrown, but just catch it in a try catch block and either ignore it or process it.
    0
  • 0

    Thanks,

     

    I am new to C#. I want to confirm with you that, there is only ApplicationException could be thrown from all functions from ReaderWriterLock class, and the only situation is "millisecondsTimeout expires before the lock request is granted"? Right?

     

     

    regards,

    George

    0
  • 0
    I am not familiar with this either, but from what I read, I would have to say your statements are correct.
    0
  • 0

    Cool Daniel,

     

    Question answered.

     

     

    regards,

    George

    0