mirror of
https://github.com/love2d/love.git
synced 2026-08-19 20:19:42 +02:00
Fixed more locking issues in love.thread
This commit is contained in:
@@ -78,13 +78,13 @@ namespace sdl
|
|||||||
std::string name = luax_checklstring(L, 2);
|
std::string name = luax_checklstring(L, 2);
|
||||||
t->lock();
|
t->lock();
|
||||||
ThreadVariant *v = t->receive(name);
|
ThreadVariant *v = t->receive(name);
|
||||||
|
t->clear(name);
|
||||||
|
t->unlock();
|
||||||
if (!v)
|
if (!v)
|
||||||
{
|
{
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
t->clear(name);
|
|
||||||
t->unlock();
|
|
||||||
switch(v->type)
|
switch(v->type)
|
||||||
{
|
{
|
||||||
case BOOLEAN:
|
case BOOLEAN:
|
||||||
@@ -123,13 +123,13 @@ namespace sdl
|
|||||||
std::string name = luax_checklstring(L, 2);
|
std::string name = luax_checklstring(L, 2);
|
||||||
t->lock();
|
t->lock();
|
||||||
ThreadVariant *v = t->demand(name);
|
ThreadVariant *v = t->demand(name);
|
||||||
|
t->clear(name);
|
||||||
|
t->unlock();
|
||||||
if (!v)
|
if (!v)
|
||||||
{
|
{
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
t->clear(name);
|
|
||||||
t->unlock();
|
|
||||||
switch(v->type)
|
switch(v->type)
|
||||||
{
|
{
|
||||||
case BOOLEAN:
|
case BOOLEAN:
|
||||||
|
|||||||
Reference in New Issue
Block a user