You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What, exactly, are the guaranteed semantics of acquisition and release of the example resource lock when the before and after methods are invoked for test? Is it:
acquired once, held across the three methods, then released?
acquired before calling each of the three method and released after each return?
only acquired for the duration of test, potentially allowing the code in before and after to race?
completely unspecified, so nobody should rely on any particular behavior?
The SharedResourcesDemo example from the guide seems to indicate the first interpretation is correct, because I think it's possible to show it having undesired behavior under other interpretations, but I'd rather be 100% sure.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Suppose we have the following:
What, exactly, are the guaranteed semantics of acquisition and release of the
example
resource lock when thebefore
andafter
methods are invoked fortest
? Is it:test
, potentially allowing the code inbefore
andafter
to race?The SharedResourcesDemo example from the guide seems to indicate the first interpretation is correct, because I think it's possible to show it having undesired behavior under other interpretations, but I'd rather be 100% sure.
Beta Was this translation helpful? Give feedback.
All reactions