Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
2.6 KiB

  1. #---------------------------------------------------------------------
  2. package Win32::Event;
  3. #
  4. # Copyright 1998 Christopher J. Madsen
  5. #
  6. # Author: Christopher J. Madsen <[email protected]>
  7. # Created: 3 Feb 1998 from the ActiveWare version
  8. # Version: 1.00 (6-Feb-1998)
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the same terms as Perl itself.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See either the
  16. # GNU General Public License or the Artistic License for more details.
  17. #
  18. # Use Win32 event objects for synchronization
  19. #---------------------------------------------------------------------
  20. $VERSION = '1.01';
  21. use Win32::IPC 1.00 '/./'; # Import everything
  22. require Exporter;
  23. require DynaLoader;
  24. @ISA = qw(Exporter DynaLoader Win32::IPC);
  25. @EXPORT_OK = qw(
  26. wait_all wait_any INFINITE
  27. );
  28. bootstrap Win32::Event;
  29. 1;
  30. __END__
  31. =head1 NAME
  32. Win32::Event - Use Win32 event objects from Perl
  33. =head1 SYNOPSIS
  34. use Win32::Event;
  35. $event = Win32::Event->new($manual,$initial,$name);
  36. $event->wait();
  37. =head1 DESCRIPTION
  38. This module allows access to the Win32 event objects. The C<wait>
  39. method and C<wait_all> & C<wait_any> functions are inherited from the
  40. L<"Win32::IPC"> module.
  41. =head2 Methods
  42. =over 4
  43. =item $event = Win32::Event->new([$manual, [$initial, [$name]]])
  44. Constructor for a new event object. If C<$manual> is true, you must
  45. manually reset the event after it is signalled (the default is false).
  46. If C<$initial> is true, the initial state of the object is signalled
  47. (default false). If C<$name> is omitted, creates an unnamed event
  48. object.
  49. If C<$name> signifies an existing event object, then C<$manual> and
  50. C<$initial> are ignored and the object is opened.
  51. =item $event = Win32::Event->open($name)
  52. Constructor for opening an existing event object.
  53. =item $event->pulse
  54. Signal the C<$event> and then immediately reset it. If C<$event> is a
  55. manual-reset event, releases all threads currently blocking on it. If
  56. it's an auto-reset event, releases just one thread.
  57. If no threads are waiting, just resets the event.
  58. =item $event->reset
  59. Reset the C<$event> to nonsignalled.
  60. =item $event->set
  61. Set the C<$event> to signalled.
  62. =item $event->wait([$timeout])
  63. Wait for C<$event> to be signalled. See L<"Win32::IPC">.
  64. =back
  65. =head1 AUTHOR
  66. Christopher J. Madsen E<lt>F<[email protected]>E<gt>
  67. =cut
  68. # Local Variables:
  69. # tmtrack-file-task: "Win32::Event"
  70. # End: