----- Forwarded message from [EMAIL PROTECTED] -----
Date: Mon, 31 Jan 2000 23:05:07 +0100
Subject: CPAN Upload: JPRIT/Event-0.61.tar.gz
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED],
[EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
The uploaded file
Event-0.61.tar.gz
has entered CPAN as
file: $CPAN/authors/id/JPRIT/Event-0.61.tar.gz
size: 62314 bytes
md5: 86deda423125396a9edb56b54d05e2e4
No action is required on your part
Request entered by: JPRIT (Joshua N. Pritikin)
Request entered on: Mon, 31 Jan 2000 22:04:47 GMT
Request completed: Mon, 31 Jan 2000 22:05:06 GMT
Virtually Yours,
Id: paused,v 1.68 1999/10/22 14:39:12 k Exp k
----- End forwarded message -----
# This is a patch for Event-0.60 to update it to Event-0.61
#
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# If you have a decent Bourne-type shell:
# STEP 2: Run the shell with this file as input.
# If you don't have such a shell, you may need to manually create
# the files as shown below.
# STEP 3: Run the 'patch' program with this file as input.
#
# These are the commands needed to create/delete files/directories:
#
touch 't/unconfigured.t'
chmod 0444 't/unconfigured.t'
#
# This command terminates the shell and need not be executed manually.
exit
#
#### End of Preamble ####
#### Patch data follows ####
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/ChangeLog'
'/usr/tmp/mp2624.d/new/Event-0.61/ChangeLog'
Index: ./ChangeLog
--- ./ChangeLog Wed Jan 26 12:47:47 2000
+++ ./ChangeLog Mon Jan 31 17:02:33 2000
@@ -1,4 +1,24 @@
+2000-01-31 Joshua Pritikin <[EMAIL PROTECTED]>
+
+ * Release 0.61.
+
+ * is_cancelled() method (requested by
+ [EMAIL PROTECTED])
+
+ * Doc updates.
+
+ * Prevent starting unconfigured or badly configured
+ watchers. Added tests. ([EMAIL PROTECTED])
+
+ XXX DANGER! THIS CHANGE CAN BREAK EXISTING CODE !DANGER XXX
+
+ * Refuse to start cancelled watchers. Added test & updated doc.
+ ([EMAIL PROTECTED]).
+
2000-01-26 Joshua Pritikin <[EMAIL PROTECTED]>
+
+ * If parked=>0 then the constructor will not invoke
+ $watcher->start(). ([EMAIL PROTECTED])
* Release 0.60.
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/Event.xs'
'/usr/tmp/mp2624.d/new/Event-0.61/Event.xs'
Index: ./Event.xs
--- ./Event.xs Wed Jan 19 11:45:47 2000
+++ ./Event.xs Mon Jan 31 11:40:12 2000
@@ -617,6 +617,12 @@ pe_watcher::is_queued(...)
XPUSHs(boolSV(WaFLAGS(THIS) & PE_QUEUED));
void
+pe_watcher::is_cancelled(...)
+ PPCODE:
+ PUTBACK;
+ XPUSHs(boolSV(WaCANCELLED(THIS)));
+
+void
pe_watcher::cb(...)
PPCODE:
PUTBACK;
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/MANIFEST'
'/usr/tmp/mp2624.d/new/Event-0.61/MANIFEST'
Index: ./MANIFEST
--- ./MANIFEST Thu Jan 20 09:32:27 2000
+++ ./MANIFEST Mon Jan 31 09:16:05 2000
@@ -59,6 +59,7 @@ t/reenter.t
t/signal.t
t/timeout_cb.t
t/timer.t
+t/unconfigured.t
t/var.t
typemap
util/bench.pl
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/TODO'
'/usr/tmp/mp2624.d/new/Event-0.61/TODO'
Index: ./TODO
--- ./TODO Wed Jan 26 11:18:18 2000
+++ ./TODO Mon Jan 31 12:33:43 2000
@@ -1,5 +1,3 @@
-don't invoke start method in the constructor: parked => 1 ?
-
increase the number of priority levels?
ASYNC 0 1 2 3 4 5 6 7 8 9 IDLE
HIGH NORM
@@ -12,7 +10,6 @@ find owner for Win32 port
documentation
how to design new event types (in perl)
how to design new event types (in C)??
- distinguish between attributes and constructor attributes
optimization
update io event-mask without invalidating cache
@@ -21,13 +18,30 @@ optimization
queue events from both sides?
try to hoist system calls from the inner loop
+inactivity
+ For a single watcher, a simple timeout would surely have the same
+ effect. But if there would be a watcher grouping feature (as you
+ indicated), watching groups of watchers could provide a new dimension
+ of flexibility.
+
+add timeout for var watchers?
+
[EMAIL PROTECTED] signal discussion:
The API rsignal overrides the current signal handler. If the signal
watcher is cancelled (or otherwise disabled) then rsignal is reset to
- SIG_DFL. You bring up a good point here. Maybe the original handler
+ SIG_DFL. Maybe the original handler
should be restored. On the other hand, assignment to %SIG will mess
up Event watchers so maybe Event should refuse to watch a signal if a
handler is already installed.
+
+there seems to be some sort of bug in the shutdown phase
+> Attempt to free unreferenced scalar during global destruction.
+> Use of uninitialized value during global destruction.
+> Explicit blessing to '' (assuming package main) during global
+> destruction.
+
+If I install a watcher and delay the call of loop(), what about
+events arriving in the meantime?
loop
StarvePrio?
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/c/io.c'
'/usr/tmp/mp2624.d/new/Event-0.61/c/io.c'
Index: ./c/io.c
--- ./c/io.c Wed Jan 19 10:47:21 2000
+++ ./c/io.c Mon Jan 31 09:04:59 2000
@@ -33,11 +33,11 @@ static void pe_io_dtor(pe_watcher *_ev)
}
static void pe_io_start(pe_watcher *_ev, int repeat) {
+ STRLEN n_a;
+ int ok=0;
pe_io *ev = (pe_io*) _ev;
- if (SvOK(ev->handle)) {
- STRLEN n_a;
+ if (SvOK(ev->handle))
ev->fd = pe_sys_fileno(ev->handle, SvPV(ev->base.desc, n_a));
- }
/* On Unix, it is possible to set the 'fd' in C code without
assigning anything to the 'handle'. This should be more
@@ -47,16 +47,21 @@ static void pe_io_start(pe_watcher *_ev,
PE_RING_UNSHIFT(&ev->ioring, &IOWatch);
++IOWatchCount;
IOWatch_OK = 0;
+ ++ok;
}
if (ev->timeout) {
WaCBTIME_on(ev);
ev->poll |= PE_T;
ev->tm.at = NVtime() + ev->timeout; /* too early okay */
pe_timeable_start(&ev->tm);
+ ++ok;
} else {
WaCBTIME_off(ev);
ev->poll &= ~PE_T;
}
+ if (!ok)
+ croak("Event: attempt to start unconfigured io watcher '%s'",
+ SvPV(ev->base.desc, n_a));
}
static void pe_io_stop(pe_watcher *_ev) {
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/c/signal.c'
'/usr/tmp/mp2624.d/new/Event-0.61/c/signal.c'
Index: ./c/signal.c
--- ./c/signal.c Wed Jan 19 10:48:05 2000
+++ ./c/signal.c Mon Jan 31 12:01:07 2000
@@ -49,8 +49,10 @@ static void pe_signal_dtor(pe_watcher *e
static void pe_signal_start(pe_watcher *_ev, int repeat) {
pe_signal *ev = (pe_signal*) _ev;
int sig = ev->signal;
- if (sig == 0)
- croak("No signal");
+ if (sig == 0) {
+ STRLEN n_a;
+ croak("Event: '%s' watching no signal", SvPV(ev->base.desc, n_a));
+ }
if (PE_RING_EMPTY(&Sigring[sig]))
rsignal(sig, process_sighandler);
PE_RING_UNSHIFT(&ev->sring, &Sigring[sig]);
@@ -119,12 +121,11 @@ static void pe_signal_asynccheck() {
if (st->Hits) _signal_asynccheck(st);
}
-
static void boot_signal() {
int xx;
int sig;
char **sigp;
- /* is it perhaps a bit crufty to hardcode this list */
+ /* it is crufty to hardcode this list */
static char *nohandle[] = { "KILL", "STOP", "ZERO", 0 };
pe_watcher_vtbl *vt = &pe_signal_vtbl;
Zero(&Sigstat[0], 1, pe_sig_stat);
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/c/timer.c'
'/usr/tmp/mp2624.d/new/Event-0.61/c/timer.c'
Index: ./c/timer.c
--- ./c/timer.c Wed Jan 19 10:48:25 2000
+++ ./c/timer.c Mon Jan 31 09:09:23 2000
@@ -20,6 +20,7 @@ static void pe_timer_dtor(pe_watcher *ev
}
static void pe_timer_start(pe_watcher *ev, int repeat) {
+ STRLEN n_a;
pe_timer *tm = (pe_timer*) ev;
if (repeat) {
/* We just finished the callback and need to re-insert at
@@ -27,14 +28,16 @@ static void pe_timer_start(pe_watcher *e
double interval;
if (!sv_2interval(tm->interval, &interval))
- croak("Repeating timer with no interval");
+ croak("Event: repeating timer '%s' has no interval",
+ SvPV(tm->base.desc, n_a));
if (interval <= 0)
- croak("Timer has non-positive interval");
+ croak("Event: timer '%s' has non-positive interval",
+ SvPV(tm->base.desc, n_a));
tm->tm.at = interval + (WaHARD(ev)? tm->tm.at : NVtime());
}
if (!tm->tm.at)
- croak("Timer unset");
+ croak("Event: timer '%s' unset", SvPV(tm->base.desc, n_a));
pe_timeable_start(&tm->tm);
}
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/c/var.c'
'/usr/tmp/mp2624.d/new/Event-0.61/c/var.c'
Index: ./c/var.c
--- ./c/var.c Wed Jan 19 11:01:30 2000
+++ ./c/var.c Mon Jan 31 09:12:37 2000
@@ -53,6 +53,7 @@ static I32 tracevar_w(IV ix, SV *sv)
{ pe_tracevar((pe_watcher *)ix, sv, PE_W); return 0; /*ignored*/ }
static void pe_var_start(pe_watcher *_ev, int repeat) {
+ STRLEN n_a;
struct ufuncs *ufp;
MAGIC **mgp;
MAGIC *mg;
@@ -60,16 +61,19 @@ static void pe_var_start(pe_watcher *_ev
SV *sv = ev->variable;
if (!sv || !SvOK(sv))
- croak("No variable specified");
+ croak("Event: var watcher '%s' watching what?", SvPV(_ev->desc, n_a));
if (!ev->events)
- croak("No events specified");
+ croak("Event: var watcher '%s' with no events specified",
+ SvPV(_ev->desc, n_a));
sv = SvRV(sv);
if (SvREADONLY(sv))
- croak("Cannot trace read-only variable");
+ croak("Event: '%s' cannot trace read-only variable",
+ SvPV(_ev->desc, n_a));
if (!SvUPGRADE(sv, SVt_PVMG))
croak("Trace SvUPGRADE failed");
if (mg_find(sv, 'U'))
- croak("Variable already being traced");
+ croak("Event: '%s' failed because var=0x%p is already being traced",
+ SvPV(_ev->desc, n_a), sv);
mgp = &SvMAGIC(sv);
while ((mg = *mgp)) {
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/c/watcher.c'
'/usr/tmp/mp2624.d/new/Event-0.61/c/watcher.c'
Index: ./c/watcher.c
--- ./c/watcher.c Thu Jan 20 14:08:59 2000
+++ ./c/watcher.c Mon Jan 31 08:46:10 2000
@@ -316,6 +316,11 @@ static void pe_watcher_resume(pe_watcher
static void pe_watcher_on(pe_watcher *wa, int repeat) {
if (WaPOLLING(wa) || WaSUSPEND(wa)) return;
+ if (WaCANCELLED(wa)) {
+ STRLEN n_a;
+ croak("Event: attempt to start cancelled watcher '%s'",
+ SvPV(wa->desc,n_a));
+ }
(*wa->vtbl->start)(wa, repeat);
WaPOLLING_on(wa); /* must happen nowhere else!! */
}
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/lib/Event.pm'
'/usr/tmp/mp2624.d/new/Event-0.61/lib/Event.pm'
Index: ./lib/Event.pm
--- ./lib/Event.pm Wed Jan 26 12:45:35 2000
+++ ./lib/Event.pm Mon Jan 31 17:01:20 2000
@@ -13,7 +13,7 @@ use Carp;
eval { require Carp::Heavy; }; # work around perl_call_pv bug XXX
use vars qw($VERSION @EXPORT_OK
$API $DebugLevel $Eval $DIED $Now);
-$VERSION = '0.60';
+$VERSION = '0.61';
# If we inherit DynaLoader then we inherit AutoLoader; Bletch!
require DynaLoader;
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/lib/Event.pod'
'/usr/tmp/mp2624.d/new/Event-0.61/lib/Event.pod'
Index: ./lib/Event.pod
--- ./lib/Event.pod Wed Jan 26 11:11:19 2000
+++ ./lib/Event.pod Mon Jan 31 11:42:25 2000
@@ -90,7 +90,7 @@ or
$w = Event::type( [attr1 => $value,]...);
Where I<type> is substituted with the kind of watcher. Built-in types
-include idle, inactivity, io, signal, timer, and var.
+include idle, io, signal, timer, and var.
New watchers (hopefully) have reasonable defaults and can also be
customized by passing extra attributes to the constructor. When
@@ -108,12 +108,13 @@ For example:
$watcher->cb(\&some_code); # set callback
- warn $watcher->desc.": ".$watcher->hits." events happened; Wow!";
+ warn $event->w->desc.": ".$event->hits." events happened; Wow!";
-All watchers support at least the following attributes: cb, hits,
-prio, desc, repeat, debug, and reentrant. Most watchers also offer
-additional attributes according to their specialty. Moreover, some
-attributes are only meaningful when passed via the constructor.
+All watchers support the following attributes: cb, cbtime, debug,
+desc, prio, max_cb_tm, reentrant, repeat, and running. Watcher
+constructors accept the preceding and additionally: async and nice.
+All events support: hits, prio, and w. Moreover, watchers also offer
+extra attributes according to their specialty.
=head2 Shared Watcher Methods
@@ -123,7 +124,10 @@ The following methods are available for
=item $watcher->start
-Activate the watcher. Most constructors return already active
+Activate the watcher. Watchers refuse to C<start()> without
+sufficient configuration information to generate events. Constructors
+always invoke C<start()> unless the C<parked=>1> option is requested.
+You will need to set the parked option if you preallocate unconfigured
watchers.
=item $watcher->again
@@ -150,8 +154,13 @@ methods.
=item $watcher->cancel
Stop and destroy C<$watcher>. Running events are allowed to complete
-but pending events are cancelled. If an attempt is made to use
-C<$watcher> after calling C<cancel> then an exception will be thrown.
+but pending events are cancelled. Cancelled watchers are no longer
+valid except for read-only type operations. For example, prio() will
+return the watcher's priority, but start() will always fail.
+
+=item $watcher->is_cancelled
+
+Reports whether the C<$watcher> has been cancelled.
=item $watcher->is_active
@@ -176,15 +185,23 @@ The callback is invoked only when no eve
never a chance to idle, an event will be generated at least every
C<max> seconds and not more often than C<min> seconds.
-=item inactivity
+=item inactivity (EXPERIMENTAL)
Extra attributes: level => $level, timeout => $seconds
-Not yet documented.
+Inactivity watchers are similar to idle watchers. The difference is
+that they judge idleness by whether there have been any events with
+priority higher than the threshold C<$level>.
+
+If you find these useful, then send email to the mailing list.
+Otherwise, they might be deprecated.
=item var
-Extra attributes: var => \$var, poll => 'rw'
+Extra attributes: var => \$var, poll => 'rw', got => 'rw',
+
+Var watchers generate events when the given variable is read from or
+written to.
=item timer
@@ -234,17 +251,36 @@ Not yet implemented.
=back
-=head2 ATTRIBUTES
+=head2 WATCHER CONSTRUCTOR ATTRIBUTES
-The following attributes currently have a meaning:
+These options are only supported as constructor arguments.
=over 4
=item after => $seconds
+See the discussion of the timer watcher.
+
=item async => $bool
-For use in the constructor to specify a priority of -1.
+If $bool then the watcher priority is set to -1.
+
+=item nice => $int
+
+Offset from the default priority. All watchers have a default
+priority of ${"Event::${type}::DefaultPriority"}.
+
+=item parked => $yes
+
+By default, watcher constructors automatically invoke the C<start()>
+method. If you don't want the watcher started then request
+C<parked=>1>.
+
+=back
+
+=head2 WATCHER ATTRIBUTES
+
+=over 4
=item at => $time
@@ -284,24 +320,12 @@ constructed.
The C<flag> attribute encodes information about the state of an
event. [XXX Fill in exact bits] [DEPRECATED?]
-=item got => $bits
-
-C<got> is available in the callback of watchers with C<poll>.
-C<got> is in the same format as C<poll> except that it gives what
-kind of event actually happened. In contrast, C<poll> is just an
-expression of interest.
-
=item hard => $bool
-Determines how repeating timers are recalculated. The timer is
-restarted either before or after the callback depending on whether it
-is true or false, respectively. In long-running callbacks this can
-make a significant difference.
-
-=item hits => $int
-
-A watcher increments C<hits> every time it registers an event.
-Signals in quick succession can be clumped into a single event.
+Determines how repeating timers (or timeouts) are recalculated. The
+timer is restarted either before or after the callback depending on
+whether it is true or false, respectively. In long-running callbacks
+this can make a significant difference.
=item interval => $seconds
@@ -310,6 +334,8 @@ recalculated using C<interval> upon call
=item level => $priority
+For inactivity - EXPERIMENTAL.
+
=item max => $seconds
The maximum number of seconds to wait before triggering the callback.
@@ -325,12 +351,6 @@ is normally disabled. See L<Event::Stat
Enforce a minimum number of seconds between triggering events.
-=item nice => $int
-
-For use in constructors to specify the offset from the default
-priority. All watchers have a default priority. See
-${"Event::${type}::DefaultPriority"}.
-
=item poll => $bits
Determines which kinds of events are of interest. This attribute can
@@ -349,6 +369,9 @@ Thus, both of these statements enable in
$w->poll($w->poll . 'r');
$w->poll($w->poll | R);
+A given type of watcher may support all or a subset of the available
+events.
+
=item prio => $int
Priority is used to sort the event queue. Meaningful priorities range
@@ -361,11 +384,12 @@ immediately upon event occurance. Use t
may seem advantageous to use negative priorities, they bypass the
whole point of having an event queue.
-Event constructors also accept C<nice> as an offset from the default
-priority. Each type of event has a default priority. Most normal
-watchers default to C<PRIO_NORMAL> and most asyncronous watchers
-default to C<PRIO_HIGH>. Default priorities are stored in
-${"Event::${type}::DefaultPriority"}.
+ ASYNC 0 1 2 3 4 5 6 IDLE
+ HIGH NORM
+
+You should not specify prio in the constructor. Use C<nice> instead
+for an offset from the default priority. Default priorities are
+stored in ${"Event::${type}::DefaultPriority"}.
=item reentrant => $bool
@@ -421,6 +445,35 @@ A reference to the variable being watche
=back
+=head2 EVENT ATTRIBUTES
+
+=over 4
+
+=item got => $bits
+
+C<got> is available in the callback of watchers with C<poll>.
+C<got> is in the same format as C<poll> except that it gives what
+kind of event actually happened. In contrast, C<poll> is just an
+expression of interest.
+
+=item hits => $int
+
+A watcher increments C<hits> every time it registers an event.
+Signals in quick succession can be clumped into a single event.
+
+=item prio => $int
+
+The event's priority. Be aware that this priority can differ from the
+watcher's priority since the watcher's priority may have changed since
+the event was generated. Moreover, the C extension API offers the
+freedom to queue events of any priority.
+
+=item w => $watcher
+
+This method return the event's watcher. It is read-only.
+
+=back
+
=head2 Customization and Exceptions
The bulk of Event's implementation is in C for B<maximum>
@@ -556,7 +609,7 @@ the timeout.
=head1 ALSO SEE
-L<Time::HiRes>, L<Time::Warp>, and L<NetServer::ProcessTop>.
+L<Time::HiRes>, L<NetServer::ProcessTop>, and L<Time::Warp>.
=head1 SUPPORT
@@ -586,9 +639,11 @@ those lists below and folks mentioned in
Gisle Aas E<lt>F<[EMAIL PROTECTED]>E<gt>
E<lt>F<[EMAIL PROTECTED]>E<gt> (Win32)
E<lt>F<[EMAIL PROTECTED]>E<gt> (File::Tail)
+ Uri Guttman E<lt>F<[EMAIL PROTECTED]>E<gt>
Nick Ing-Simmons E<lt>F<[EMAIL PROTECTED]>E<gt> (Tk)
Mark Mielke E<lt>F<[EMAIL PROTECTED]>E<gt>
Sarathy E<lt>F<[EMAIL PROTECTED]>E<gt>
+ E<lt>F<[EMAIL PROTECTED]>E<gt>
=head1 COPYRIGHT
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/lib/Event/Watcher.pm'
'/usr/tmp/mp2624.d/new/Event-0.61/lib/Event/Watcher.pm'
Index: ./lib/Event/Watcher.pm
--- ./lib/Event/Watcher.pm Wed Jan 26 12:45:18 2000
+++ ./lib/Event/Watcher.pm Wed Jan 26 15:57:36 2000
@@ -63,6 +63,8 @@ sub init {
}
}
+ my $parked = delete $arg->{parked};
+
for my $k (keys %$arg) {
my $m = $k;
if ($o->can($m)) {
@@ -74,6 +76,7 @@ sub init {
Carp::cluck "creating ".ref($o)." desc='".$o->desc."'\n"
if $Event::DebugLevel >= 3;
+ $o->start unless $parked;
$o;
}
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/lib/Event/idle.pm'
'/usr/tmp/mp2624.d/new/Event-0.61/lib/Event/idle.pm'
Index: ./lib/Event/idle.pm
--- ./lib/Event/idle.pm Wed Dec 22 17:00:07 1999
+++ ./lib/Event/idle.pm Wed Jan 26 15:55:51 2000
@@ -25,7 +25,6 @@ sub new {
$o->repeat(1) if defined $arg{min} || defined $arg{max};
$o->init(\%arg);
- $o->start;
$o;
}
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/lib/Event/inactivity.pm'
'/usr/tmp/mp2624.d/new/Event-0.61/lib/Event/inactivity.pm'
Index: ./lib/Event/inactivity.pm
--- ./lib/Event/inactivity.pm Wed Dec 22 17:00:07 1999
+++ ./lib/Event/inactivity.pm Wed Jan 26 15:55:44 2000
@@ -25,7 +25,6 @@ sub new {
$o->{e_timeout} = delete $o->{timeout} || 10;
$o->{e_level} = delete $o->{level} || PRIO_NORMAL;
$o->init(\%arg);
- $o->start();
$o;
}
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/lib/Event/io.pm'
'/usr/tmp/mp2624.d/new/Event-0.61/lib/Event/io.pm'
Index: ./lib/Event/io.pm
--- ./lib/Event/io.pm Wed Dec 22 17:00:07 1999
+++ ./lib/Event/io.pm Wed Jan 26 15:55:36 2000
@@ -14,7 +14,6 @@ sub new {
my %arg = @_;
my $o = allocate($class, delete $arg{attach_to} || {});
$o->init(\%arg);
- $o->start;
$o;
}
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/lib/Event/signal.pm'
'/usr/tmp/mp2624.d/new/Event-0.61/lib/Event/signal.pm'
Index: ./lib/Event/signal.pm
--- ./lib/Event/signal.pm Wed Dec 22 17:00:07 1999
+++ ./lib/Event/signal.pm Wed Jan 26 15:55:32 2000
@@ -15,7 +15,6 @@ sub new {
my %arg = @_;
my $o = allocate($class, delete $arg{attach_to} || {});
$o->init(\%arg);
- $o->start;
$o;
}
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/lib/Event/timer.pm'
'/usr/tmp/mp2624.d/new/Event-0.61/lib/Event/timer.pm'
Index: ./lib/Event/timer.pm
--- ./lib/Event/timer.pm Wed Dec 22 17:00:07 1999
+++ ./lib/Event/timer.pm Wed Jan 26 15:55:26 2000
@@ -44,7 +44,6 @@ sub new {
}
$o->init(\%arg);
- $o->start();
$o;
}
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/lib/Event/var.pm'
'/usr/tmp/mp2624.d/new/Event-0.61/lib/Event/var.pm'
Index: ./lib/Event/var.pm
--- ./lib/Event/var.pm Wed Dec 22 17:00:07 1999
+++ ./lib/Event/var.pm Wed Jan 26 15:55:23 2000
@@ -13,7 +13,6 @@ sub new {
my %arg = @_;
my $o = allocate($class, delete $arg{attach_to} || {});
$o->init(\%arg);
- $o->start;
$o;
}
gdiff -up '/usr/tmp/mp2624.d/old/Event-0.60/t/leak.t'
'/usr/tmp/mp2624.d/new/Event-0.61/t/leak.t'
Index: ./t/leak.t
--- ./t/leak.t Thu Jan 20 14:04:07 2000
+++ ./t/leak.t Mon Jan 31 11:47:41 2000
@@ -1,5 +1,5 @@
# leak -*-perl-*-
-use Test; plan test => 4;
+use Test; plan test => 6;
use Event qw(all_watchers);
my @e = Event::all_watchers();
@@ -9,7 +9,7 @@ ok @e, 0;
sub thrash {
Event->idle()->cancel;
- Event->io()->cancel;
+ Event->io(parked => 1)->cancel;
Event->signal(signal => 'INT')->cancel;
Event->timer(at => time)->cancel;
my $var = 1;
@@ -21,7 +21,10 @@ my $got = join(', ', map { ref } all_wat
ok($got, 'None');
{
- my $io = Event->io();
+ my $io = Event->io(parked => 1);
+ ok !$io->is_cancelled;
$io->cancel for 1..3; #shouldn't crash!
- ok 1;
+ ok $io->is_cancelled;
+ eval { $io->start };
+ ok $@, '/cancelled/';
}
gdiff -up /dev/null '/usr/tmp/mp2624.d/new/Event-0.61/t/unconfigured.t'
Index: ./t/unconfigured.t
--- ./t/unconfigured.t Wed Dec 31 19:00:00 1969
+++ ./t/unconfigured.t Mon Jan 31 09:25:43 2000
@@ -0,0 +1,32 @@
+#!./perl -w
+
+use strict;
+use Test; plan test => 8;
+use Event;
+
+eval { Event->io };
+ok $@, '/unconfigured/';
+
+eval { Event->signal };
+ok $@, '/no signal/';
+
+eval { Event->timer };
+ok $@, '/unset/';
+
+eval { Event->timer(parked => 1, interval => -1)->again };
+ok $@, '/non\-positive/';
+
+eval { Event->var };
+ok $@, '/watching what/';
+
+my $var = 1;
+
+eval { Event->var(poll => 0, var => \$var) };
+ok $@, '/no events/';
+
+eval { Event->var(var => \$1) };
+ok $@, '/read\-only/';
+
+eval { Event->var(var => \$var) for 1..2 };
+ok $@, '/already being traced/';
+
#### End of Patch data ####
#### ApplyPatch data follows ####
# Data version : 1.0
# Date generated : Mon Jan 31 17:12:44 2000
# Generated by : makepatch 2.00 (2.0BETA)
# Recurse directories : Yes
# p 'ChangeLog' 20405 949356153 0100444
# p 'Event.xs' 17246 949336812 0100444
# p 'MANIFEST' 810 949328165 0100444
# p 'TODO' 1451 949340023 0100444
# p 'c/io.c' 5098 949327499 0100444
# p 'c/signal.c' 3788 949338067 0100444
# p 'c/timer.c' 2130 949327763 0100444
# p 'c/var.c' 4104 949327957 0100444
# p 'c/watcher.c' 8621 949326370 0100444
# p 'lib/Event.pm' 4159 949356080 0100444
# p 'lib/Event.pod' 19206 949336945 0100444
# p 'lib/Event/Watcher.pm' 2331 948920256 0100444
# p 'lib/Event/idle.pm' 584 948920151 0100444
# p 'lib/Event/inactivity.pm' 1309 948920144 0100444
# p 'lib/Event/io.pm' 408 948920136 0100444
# p 'lib/Event/signal.pm' 390 948920132 0100444
# p 'lib/Event/timer.pm' 1072 948920126 0100444
# p 'lib/Event/var.pm' 324 948920123 0100444
# p 't/leak.t' 543 949337261 0100444
# c 't/unconfigured.t' 0 949328743 0100444
#### End of ApplyPatch data ####
#### End of Patch kit [created: Mon Jan 31 17:12:44 2000] ####
#### Checksum: 763 24802 58821 ####
--
"May the best description of competition prevail."
via, but not speaking for Deutsche Bank