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
I passed TWO=2 on the command line and... getNumber() returns 1.
I had assumed that if I set up mutexes, only one of the arguments would ever be able to be defined. I was extremely wrong and this subtly broke my application until I noticed identical results when I didn't expect them.
Two options, I think:
If the user defines a mutex'd argument, set the other arguments all to null, regardless of their defaults.
Document that mutex only applies to what the user types, and that default arguments will remain defined even if the user defines one of the mutex.
The text was updated successfully, but these errors were encountered:
Yeah, the intention is that mutex applies to what the user is required to provide. FWIW, in your example, the mutex args are required, so the user is required provide at least one of them, making the initial values unnecessary. (Having said that, I take your point that the behavior wan't clear and should be documented better...)
I had the following setup (extremely contrived):
I passed
TWO=2
on the command line and...getNumber()
returns1
.I had assumed that if I set up mutexes, only one of the arguments would ever be able to be defined. I was extremely wrong and this subtly broke my application until I noticed identical results when I didn't expect them.
Two options, I think:
null
, regardless of their defaults.mutex
only applies to what the user types, and that default arguments will remain defined even if the user defines one of the mutex.The text was updated successfully, but these errors were encountered: