首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

SyncReaderWriter (class)

Introduction

(PECL sync >= 1.0.0)

A cross-platform, native implementation of named and unnamed reader-writer objects.

A reader-writer object allows many readers or one writer to access a resource. This is an efficient solution for managing resources where access will primarily be read-only but exclusive write access is occasionally necessary.

Class synopsis

SyncReaderWriter {

/* Methods */

代码语言:javascript
复制
public __construct ([ string $name [, bool $autounlock = true ]] )
代码语言:javascript
复制
public bool readlock ([ integer $wait = -1 ] )
代码语言:javascript
复制
public bool readunlock ( void )
代码语言:javascript
复制
public bool writelock ([ integer $wait = -1 ] )
代码语言:javascript
复制
public bool writeunlock ( void )

}

Table of Contents

  • SyncReaderWriter::__construct — Constructs a new SyncReaderWriter object
  • SyncReaderWriter::readlock — Waits for a read lock
  • SyncReaderWriter::readunlock — Releases a read lock
  • SyncReaderWriter::writelock — Waits for an exclusive write lock
  • SyncReaderWriter::writeunlock — Releases a write lock

← SyncEvent::wait

SyncReaderWriter::__construct →

代码语言:txt
复制
 ? 1997–2017 The PHP Documentation Group

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com