diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-08 17:56:39 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-08 17:56:39 -0200 |
commit | 2cf954b8ae08a9094354551ee3733f4ff8078443 (patch) | |
tree | bd6f42e34ad38802a31a135dbf446ea7e70b1427 /opcode.c | |
parent | aa7b1fcec4f4a8147150fcb726146800c3c6af7e (diff) | |
download | lua-2cf954b8ae08a9094354551ee3733f4ff8078443.tar.gz lua-2cf954b8ae08a9094354551ee3733f4ff8078443.tar.bz2 lua-2cf954b8ae08a9094354551ee3733f4ff8078443.zip |
lock mechanism
Diffstat (limited to 'opcode.c')
-rw-r--r-- | opcode.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_opcode="$Id: opcode.c,v 3.4 1994/11/07 16:34:44 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.5 1994/11/07 18:27:39 roberto Exp $"; |
7 | 7 | ||
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
@@ -545,14 +545,24 @@ void *lua_getuserdata (lua_Object object) | |||
545 | else return (uvalue(Address(object))); | 545 | else return (uvalue(Address(object))); |
546 | } | 546 | } |
547 | 547 | ||
548 | |||
549 | lua_Object lua_getlocked (int ref) | ||
550 | { | ||
551 | adjustC(0); | ||
552 | *(top++) = *luaI_getlocked(ref); | ||
553 | CBase++; /* incorporate object in the stack */ | ||
554 | return Ref(top-1); | ||
555 | } | ||
556 | |||
548 | /* | 557 | /* |
549 | ** Get a global object. Return the object handle or NULL on error. | 558 | ** Get a global object. Return the object handle or NULL on error. |
550 | */ | 559 | */ |
551 | lua_Object lua_getglobal (char *name) | 560 | lua_Object lua_getglobal (char *name) |
552 | { | 561 | { |
553 | int n = lua_findsymbol(name); | 562 | int n = lua_findsymbol(name); |
554 | if (n < 0) return 0; | 563 | adjustC(0); |
555 | *(top++) = s_object(n); | 564 | *(top++) = s_object(n); |
565 | CBase++; /* incorporate object in the stack */ | ||
556 | return Ref(top-1); | 566 | return Ref(top-1); |
557 | } | 567 | } |
558 | 568 | ||