Perhaps it is worth mentioning, in this particular case, that the lock function doesn't need an explicit unlock. Rather, a locked variable becomes unlocked when the code execution exits the current scope.
In reply to Re: Threads: why locking is required when using shared variables
by monarch
in thread Threads: why locking is required when using shared variables
by ikegami
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |