On Sep 29, 2006 6:31 AM, Phil M wrote: > I am trying to use a Mutex to prevent multiple copies of my > application from writing to the same REALSQLdatabase file. > > My code below seems to be working as expected -- logging confirms > that exactly one copy is being written to the database and by one > application instance (confirmed by PID). However, I am > *not* using the Mutex.Leave() command, and that worries me a > great deal that at some point this application would "blowup" > because of Recursive calls to the Mutex.
>From what I understand the Mutex.Leave() command is used to release the lock on the mutex. If you don't use it what happens if you close you application and then try to run it again? Will it launch? BTW the LR says this about recursive calls: "You can call Enter or TryEnter multiple times in the same way as with a CriticalSection, including recursive calls." > My question is if this is the proper way to lock the > REALSQLdatabase resource? I think that's should work fine as there will be just one instance of your application running. > There are no examples of the new REALbasic Mutex Class that I am > aware of. Check Aaron's blog: http://ramblings.aaronballman.com/?p=431 http://ramblings.aaronballman.com/?p=432 Carlos _______________________________________________ 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>
