I am working with multi-threading. There is a thread that periodically adds to a certain variable, say every 5 seconds. I want to make it so that, given a call to function f(), additions to that variable will have no effect.
I can't find how to do this anywhere and I'm not sure where to start. Is there any syntax that makes certain operations not no effect no specific variables for a certain duration?
Or is there any starting point someone could give me and I can figure out the rest?
Thanks.