Browse Source

Peek gets locks too

Bart van Strien 14 years ago
parent
commit
fd34409bd4
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/modules/thread/sdl/wrap_Thread.cpp

+ 2 - 0
src/modules/thread/sdl/wrap_Thread.cpp

@@ -166,7 +166,9 @@ namespace sdl
 	{
 		Thread *t = luax_checkthread(L, 1);
 		std::string name = luax_checklstring(L, 2);
+		t->lock();
 		ThreadVariant *v = t->receive(name);
+		t->unlock();
 		if (!v)
 		{
 			lua_pushnil(L);