home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / Share / Editores / Perl5 / perl / lib / site / Win32 / IPC.pm < prev    next >
Encoding:
Perl POD Document  |  1997-08-10  |  1.3 KB  |  63 lines

  1. package Win32::IPC;
  2.  
  3. $VERSION = '0.02';
  4.  
  5. =head1 NAME
  6.  
  7. Win32::IPC - Support module for Semaphores, Mutexes,Process
  8. and ChangeNotify Synchronization
  9.  
  10. =head1 SYNOPSIS
  11.  
  12.     use Win32::Process;
  13.     #Create objects.
  14.     
  15.     Win32::Process::WaitForMultipleObjects(@ListOfObjects,$WaitAll,$Timeout);
  16.  
  17. =head1 DESCRIPTION
  18.  
  19. This module is loaded by any of the IPC supporting modules. (listed above).
  20. It supplies the WaitForMultipleObjects call to those objects.
  21.  
  22. =cut
  23.  
  24. require Exporter;
  25. require DynaLoader;
  26. require AutoLoader;
  27.  
  28. @ISA = qw(Exporter DynaLoader);
  29. @EXPORT = qw(
  30.     INFINITE
  31.     WaitForMultipleObjects
  32. );
  33.  
  34. sub AUTOLOAD {
  35.     # This AUTOLOAD is used to 'autoload' constants from the constant()
  36.     # XS function.  If a constant is not found then control is passed
  37.     # to the AUTOLOAD in AutoLoader.
  38.  
  39.     my($constname);
  40.     ($constname = $AUTOLOAD) =~ s/.*:://;
  41.     #reset $! to zero to reset any current errors.
  42.     $!=0;
  43.     my $val = constant($constname, @_ ? $_[0] : 0);
  44.     if ($! != 0) {
  45.     if ($! =~ /Invalid/) {
  46.         $AutoLoader::AUTOLOAD = $AUTOLOAD;
  47.         goto &AutoLoader::AUTOLOAD;
  48.     }
  49.     else {
  50.         ($pack,$file,$line) = caller;
  51.         die "Your vendor has not defined Win32::IPC macro $constname, used at $file line $line.";
  52.     }
  53.     }
  54.     eval "sub $AUTOLOAD { $val }";
  55.     goto &$AUTOLOAD;
  56. }
  57.  
  58. bootstrap Win32::IPC;
  59.  
  60.  
  61. 1;
  62. __END__
  63.