Method Thread.MutexKey()->upgrade()


Method upgrade

bool upgrade()
bool upgrade(int(0..)|float seconds)
bool upgrade(int(0..) seconds, int(0..999999999) nanos)

Description

Upgrade a downgraded lock into an exclusive lock.

Parameter seconds

Seconds to wait before the timeout is reached.

Parameter nanos

Nano (1/1000000000) seconds to wait before the timeout is reached. This value is added to the number of seconds specified by seconds.

A timeout of zero seconds disables the timeout.

Note

Note that the timeout is approximate (best effort), and may be exceeded if eg the interpreter is busy after the timeout.

Waits until all concurrent shared locks are released, and upgrades this lock into being an exclusive lock. Any attempts to make new shared locks will block as soon as this function is called.

See also

downgrade(), try_upgrade()