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.

Get Perl in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.