1. 程式人生 > >python語法記錄

python語法記錄

獲取 under clas 創建 col variable span until erl

class threading.Condition(lock=None)
This class implements condition variable objects. A condition variable allows one or more threads to wait until they are notified by another thread.

If the lock argument is given and not None, it must be a Lock or RLock object, and it is used as the underlying lock
.
Otherwise, a new RLock object is created and used as the underlying lock.

也就是說,如果condition構造函數lock參數為空的話,會自動創建可重入鎖RLock

可重入鎖RLock,同一線程可以多次獲取(the same thread may acquire it again without blocking)。

python語法記錄