summaryrefslogtreecommitdiff
path: root/lib/Thread/Task/Thread.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Thread/Task/Thread.pm')
-rw-r--r--lib/Thread/Task/Thread.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Thread/Task/Thread.pm b/lib/Thread/Task/Thread.pm
index d3fa27a..e922549 100644
--- a/lib/Thread/Task/Thread.pm
+++ b/lib/Thread/Task/Thread.pm
@@ -62,6 +62,12 @@ class Thread::Task::Thread {
threads->object( $self->tid );
}
+ # always refresh the 'thread' attribute
+ # we use it only as a delegation point
+ after thread() {
+ $self->_clear_thread;
+ }
+
method spawn() {
$self->_clear_thread;
$WID2TID{$self->wid} =
@@ -108,7 +114,7 @@ class Thread::Task::Thread {
next unless $self->can($method);
try {
- $self->$method(@$method);
+ $self->$method(@$message);
}
catch (Finished_ET $e) {
last;