If this function immediately attempts to acquire the relevant lock
before evaluating the value argument,
that argument can contain interesting things. Namely, it can
access the variables within the threadLock
object knowing that these are locked. So this is convenient shorthand
for enclosing a call to this function
(threadLock.assign()) within a
getLock(x)
threadLock.assign(x,...)
yieldLock(x)
and may eradicate the problem of checking of the same thread
attempting to get the same lock recursively as would happen in the above
code snippet if
(threadLock.assign())
also attempts to acquire the lock.