pht\AtomicInteger::lockAcquires the atomic integer's mutex lock 説明
public void pht\AtomicInteger::lock
( void
)
This method will acquire the mutex lock associated with the atomic integer. The mutex lock only needs to be acquired when needing to group together multiple operations. The mutex locks of the atomic values are reentrant safe. It is therefore valid for the same thread to reacquire a mutex lock that it has already acquired. パラメータこの関数にはパラメータはありません。 戻り値No return value. 例
例1 Grouping together an atomic integer's operations (requiring a mutex lock)
<?php 上の例の出力は以下となります。 int(4) |