realbasic-nug
[Top] [All Lists]

Sanity check: Finally

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Sanity check: Finally
From: Ed Kleban <Ed at Kleban dot com>
Date: Fri, 30 Dec 2005 22:22:05 -0600
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Thread-index: AcYNwcFU/9wKH3m0EdqyhgANk0o3Jg==
Thread-topic: Sanity check: Finally
I've never used the new "finally" clause before.  Is this correct usage to
ensure that both:

1) The semaphore gets released even if an exception is caught, and

2) The caught exception will be passed on up?

I.e. is the finally clause guaranteed to execute before the catch clause
raises the error again?

 
  
  if updateInProgress.TrySignal then  // Request permission to update
    try
     self.doSomething
    catch err as RuntimeException
      raise err  // Pass err on up.
    finally
      updateInProgress.Release
    end try
  end if


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>