From: Rick M. <obj...@gm...> - 2011-07-01 14:58:20
|
On Fri, Jul 1, 2011 at 10:46 AM, Rony G. Flatscher <Ron...@wu...> wrote: > > On 01.07.2011 16:32, Rick McGuire wrote: > > Guarded state nests. So invoking an method that is unguarded does not > remove any guard protections of any other methods that might be on the > call stack. It would be absolutely wrong for the interpreter to do > so, as the method in question has requested exclusive access to the > object. Having the guarded state come and go based on any subsequent > method invocations would violate that contract. > > > Thank you very much for this clarification! > > Maybe two last questions in this context: > > if executing a SetGuardOn() multiple times in the same native method and > invocation, followed by a single SetGuardOff(), would that single > SetGuardOff() remove the guard lock? Or would one need to invoke > SetGuardOff() as many times as SetGuardOn()? The lock created by SetGuardOn() is specific to that method invocation, so it does not nest. That should work ok (but a bit strange, in my opinion). > > Would it be o.k. for a native method to do a SetGuardOff() at the entry into > the native method and a SetGuardOn() right before returning from the native > method in order to reliably define a defined state at the beginning of it? Not sure I understand what you're trying to gain there. Calling SetGuardOn() right before returning is pointless since the method termination will immediately release the lock. I don't see how this does anything to reliably define anything. Once you call SetGuardOff() at the beginning, then all bets are off regarding reliable state. Rick > > ---rony > > > ------------------------------------------------------------------------------ > All of the data generated in your IT infrastructure is seriously valuable. > Why? It contains a definitive record of application performance, security > threats, fraudulent activity, and more. Splunk takes this data and makes > sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-d2d-c2 > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > > |