educative.io

Release method can be called from any thread

Hi everyone.

At the beginning of this lecture it is said that: “A Lock object can only be unlocked by a thread that locked it in the first place.”

However, python doc for “release” method states that: “This can be called from any thread, not only the thread which has acquired the lock.”.

For my point of view the two statements are in contradiction.
Can you please explain me what you mean with the statement in the tutorial?

Thank you in advance.
Fabio


Type your question above this line.

Course: https://www.educative.io/collection/5307417243942912/5668546535227392
Lesson: https://www.educative.io/collection/page/5307417243942912/5668546535227392/6315297457831936

2 Likes

You are absolutely right. But the article seems like it has NOT been corrected in 2 years.