Perl in a Nutshell

Perl in a NutshellSearch this book
Previous: 19.13 Win32::RegistryChapter 19
Win32 Modules and Extensions
Next: 19.15 Win32::Service
 

19.14 Win32::Semaphore

The Win32::Semaphore module implements semaphores, synchronizing access to shared resources. The constructor new creates a new semaphore object and sets the initial count and the maximum count of the semaphore. The constructor has the following syntax:

$sem = Win32::Semaphore->new(init, max, [name]);
The arguments are defined as follows:

init

The initial count of the semaphore.

max

The maximum count of the semaphore.

name

A string containing a name of the semaphore.

The open constructor opens an existing semaphore object specified by name:

$sem = Win32::Semaphore->open(name);
The following methods can be used on Win32::Semaphore objects:


Previous: 19.13 Win32::RegistryPerl in a NutshellNext: 19.15 Win32::Service
19.13 Win32::RegistryBook Index19.15 Win32::Service

Library Navigation Links

Copyright © 2001 O'Reilly & Associates. All rights reserved.