在线文档教程
PHP
处理控制 | Process Control

Mutex (class)

The Mutex class

Introduction

(PECL pthreads < 3.0.0)

Warning

The Mutex class has been removed in pthreads v3.

The static methods contained in the Mutex class provide direct access to Posix Mutex functionality.

Class synopsis

Mutex {

/* Methods */

final public static long create ([ boolean $lock ] )

final public static boolean destroy ( long $mutex )

final public static boolean lock ( long $mutex )

final public static boolean trylock ( long $mutex )

final public static boolean unlock ( long $mutex [, boolean $destroy ] )

}

Table of Contents

  • Mutex::create — Create a Mutex

  • Mutex::destroy — Destroy Mutex

  • Mutex::lock — Acquire Mutex

  • Mutex::trylock — Attempt to Acquire Mutex

  • Mutex::unlock — Release Mutex

← Pool::submitTo

Mutex::create →

© 1997–2017 The PHP Documentation Group

Licensed under the Creative Commons Attribution License v3.0 or later.

https://secure.php.net/manual/en/class.mutex.php