# HG changeset patch # User John W. Eaton # Date 1220456171 14400 # Node ID 16ab78b816bc8ec897bd8c00934fc2e79a6cbc48 # Parent 163d20e4d39c450943e56e3b366ce671e384c232 variables.cc (mlock): lock current function diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2008-09-03 John W. Eaton + * variables.cc (mlock): Lock current function on the call stack. + (Fmlock): Lock caller. + * symtab.cc (out_of_date_check_internal): If dispatch type is set, check for method. If that fails, check for regular function. diff --git a/src/variables.cc b/src/variables.cc --- a/src/variables.cc +++ b/src/variables.cc @@ -1888,7 +1888,7 @@ void mlock (void) { - octave_function *fcn = octave_call_stack::caller (); + octave_function *fcn = octave_call_stack::current (); if (fcn) fcn->lock (); @@ -1938,7 +1938,14 @@ octave_value_list retval; if (args.length () == 0) - mlock (); + { + octave_function *fcn = octave_call_stack::caller (); + + if (fcn) + fcn->lock (); + else + error ("mlock: invalid use outside a function"); + } else print_usage ();