From 31f8c68b4b49d7c943d176c80fc758f58566aaa5 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Fri, 11 Feb 2011 20:41:03 +0100 Subject: [PATCH] Fixed more locking issues in love.thread --- src/modules/thread/sdl/wrap_Thread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/modules/thread/sdl/wrap_Thread.cpp b/src/modules/thread/sdl/wrap_Thread.cpp index 0c751e26e..2be23b951 100644 --- a/src/modules/thread/sdl/wrap_Thread.cpp +++ b/src/modules/thread/sdl/wrap_Thread.cpp @@ -78,13 +78,13 @@ namespace sdl std::string name = luax_checklstring(L, 2); t->lock(); ThreadVariant *v = t->receive(name); + t->clear(name); + t->unlock(); if (!v) { lua_pushnil(L); return 1; } - t->clear(name); - t->unlock(); switch(v->type) { case BOOLEAN: @@ -123,13 +123,13 @@ namespace sdl std::string name = luax_checklstring(L, 2); t->lock(); ThreadVariant *v = t->demand(name); + t->clear(name); + t->unlock(); if (!v) { lua_pushnil(L); return 1; } - t->clear(name); - t->unlock(); switch(v->type) { case BOOLEAN: