comparison src/variables.cc @ 8083:16ab78b816bc

variables.cc (mlock): lock current function
author John W. Eaton <jwe@octave.org>
date Wed, 03 Sep 2008 11:36:11 -0400
parents 85184151822e
children 10b63c4fd413
comparison
equal deleted inserted replaced
8082:163d20e4d39c 8083:16ab78b816bc
1886 } 1886 }
1887 1887
1888 void 1888 void
1889 mlock (void) 1889 mlock (void)
1890 { 1890 {
1891 octave_function *fcn = octave_call_stack::caller (); 1891 octave_function *fcn = octave_call_stack::current ();
1892 1892
1893 if (fcn) 1893 if (fcn)
1894 fcn->lock (); 1894 fcn->lock ();
1895 else 1895 else
1896 error ("mlock: invalid use outside a function"); 1896 error ("mlock: invalid use outside a function");
1936 @end deftypefn") 1936 @end deftypefn")
1937 { 1937 {
1938 octave_value_list retval; 1938 octave_value_list retval;
1939 1939
1940 if (args.length () == 0) 1940 if (args.length () == 0)
1941 mlock (); 1941 {
1942 octave_function *fcn = octave_call_stack::caller ();
1943
1944 if (fcn)
1945 fcn->lock ();
1946 else
1947 error ("mlock: invalid use outside a function");
1948 }
1942 else 1949 else
1943 print_usage (); 1950 print_usage ();
1944 1951
1945 return retval; 1952 return retval;
1946 } 1953 }