summaryrefslogtreecommitdiff
path: root/fml/lib/FML/Command.pm
diff options
context:
space:
mode:
Diffstat (limited to 'fml/lib/FML/Command.pm')
-rw-r--r--fml/lib/FML/Command.pm9
1 files changed, 9 insertions, 0 deletions
diff --git a/fml/lib/FML/Command.pm b/fml/lib/FML/Command.pm
index e6fe26dd..b5e73f4c 100644
--- a/fml/lib/FML/Command.pm
+++ b/fml/lib/FML/Command.pm
@@ -55,7 +55,9 @@ sub AUTOLOAD
eval qq{ require $pkg; $pkg->import();};
unless ($@) {
if ($pkg->can($command)) {
+ $curproc->lock() if $self->require_lock($command);
$pkg->$command($curproc, $args);
+ $curproc->unlock() if $self->require_lock($command);
}
else {
Log("$pkg module has no $command method");
@@ -67,6 +69,13 @@ sub AUTOLOAD
}
+sub require_lock
+{
+ my ($self, $command) = @_;
+ $command eq 'newml' ? 0 : 1;
+}
+
+
=head1 AUTHOR
Ken'ichi Fukamachi