home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeJava and XSLTSearch this book

22.8. Win32::IPC

The Win32::IPC module provides synchronization for multiple objects created from the Semaphore, Mutex, Process, and ChangeNotify classes. The wait method of this class is inherited by objects of the preceding modules, as well as the functions wait_all and wait_any. You should not need to call Win32::IPC directly.

wait

$obj->wait([timeout])

This method is used on any synchronization object. It waits for the object to become signaled. It returns 1 if the object is signaled, -1 if the object is an abandoned mutex, 0 if the call times out, and undef on error. timeoutis the time to wait (in milliseconds). If no timeout is specified, the method waits indefinitely.

Win32::IPC also defines the two functions wait_all and wait_any.

wait_all

wait_all(@objects, [timeout])

Waits for all the synchronization objects contained in @objects to be signaled. The optional timeout parameter is the same as described for wait. The return value will be an integer that identifies the last object to be signaled (the nth object in the list, starting from 1). A negative integer (-n) indicates that the nth object was an abandoned mutex. A return of 0 means that the function timed out; undef is returned on error.



Library Navigation Links

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