Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید

22.16. 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.


$sem->release(inc, [$var])

Releases a semaphore and increments the
count by the amount specified in inc. The
last count (before the increment) is returned in the
$var variable, if
provided.


$sem->wait([timeout])

The inherited Win32::IPC call. Waits
for the semaphore''s count to be nonzero, then
decrements it. Optional timeout is given
in milliseconds.

/ 875