瀏覽代碼

Peek gets locks too

Bart van Strien 14 年之前
父節點
當前提交
fd34409bd4
共有 1 個文件被更改,包括 2 次插入0 次删除
  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);