woclass
November 22, 2021, 4:23pm
2
Maybe it’a typo, means ReentrantLock
.
In computer science , the reentrant mutex ( recursive mutex , recursive lock ) is a particular type of mutual exclusion (mutex) device that may be locked multiple times by the same process/thread , without causing a deadlock .
JuliaLang:master
← JuliaLang:jn/condition-mt
opened 07:52PM - 16 Nov 18 UTC
This extends Condition and RecursiveLock to assert that they may only be used in… the single-threaded case (co-operatively scheduled), and then adds thread-safe versions of the same (ConditionMT and RecursiveLockMT). Additionally, the constructor for `ConditionMT` lets you pass in an existing `RecursiveLockMT` to allow having multiple notifications off of a single lock.
Unlike the existing thread-safe primitives (Threads.AsyncCondition, Threads.SpinLock, Threads.Mutex), these new types integrate with the Task system also, and thus should typically be preferred to those for user code. Unlike the existing task-only primitives, these work in all situations, but require the user to write explicit lock code annotating the protected code regions.
In version 2.0, we can consider switching the default for `Condition` from `ConditionST` to `ConditionMT`, but that would be a breaking change. (ConditionMT requires the user to hold a lock before calling `wait`, while that lock is currently implicit in Condition under the assumption of cooperative tasking—as explicitly represented in this PR by the `NotALock` type.)
Implement and close #30026
woclass
November 22, 2021, 4:31pm
4
I think you can open a pr to fix it and ask vtjnash
to review.
At least, we should remove this invalid reference.
1 Like
Can you walk me through it? Do I need to create a new branch for that?
TLDR is go here https://github.com/JuliaLang/julia/blob/master/base/condition.jl , click edit (pencil icon in top right), make the changes, and github should automatically make a fork for you.
1 Like