Thread-Reentrant Locking
class ReentrantLock
attr token: 1
lockingThread: 0
meth lock(Code)
This = {ThisThread}
in
case @lockingThread == This
then {Code}
else New Old in
{Wait Old}
lockingThread <- This
{Code}
lockingThread <- 0
New = Old
end
end
end
Previous slide
Next slide
Back to first slide
View graphic version