From 885961be1d8e3f703b54d1d19e6c63617cd2ed24 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 27 Aug 2003 17:57:52 -0300 Subject: [PATCH] reader runs outside core Lua --- lzio.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lzio.c b/lzio.c index f3e1dcf6..9ee65db6 100644 --- a/lzio.c +++ b/lzio.c @@ -1,5 +1,5 @@ /* -** $Id: lzio.c,v 1.25 2003/08/25 19:51:54 roberto Exp roberto $ +** $Id: lzio.c,v 1.26 2003/08/25 20:00:50 roberto Exp roberto $ ** a generic input stream interface ** See Copyright Notice in lua.h */ @@ -13,12 +13,17 @@ #include "llimits.h" #include "lmem.h" +#include "lstate.h" #include "lzio.h" int luaZ_fill (ZIO *z) { size_t size; - const char *buff = z->reader(z->L, z->data, &size); + lua_State *L = z->L; + const char *buff; + lua_unlock(L); + buff = z->reader(L, z->data, &size); + lua_lock(L); if (buff == NULL || size == 0) return EOZ; z->n = size - 1; z->p = buff;