Proper checking if lua is running when doing thread waiting/set
This commit is contained in:
parent
0082876510
commit
2e0ac111ab
|
@ -32,6 +32,7 @@ namespace BizHawk.MultiClient
|
|||
public void Close()
|
||||
{
|
||||
lua.Close();
|
||||
LuaWait.Dispose();
|
||||
}
|
||||
|
||||
public void LuaRegister(Lua lua)
|
||||
|
|
|
@ -1620,12 +1620,12 @@ namespace BizHawk.MultiClient
|
|||
if (runFrame)
|
||||
{
|
||||
//client input-related duties
|
||||
if (LuaConsole1.LuaImp.isRunning)
|
||||
if (LuaConsole1.IsRunning())
|
||||
{
|
||||
LuaConsole1.LuaImp.LuaWait.WaitOne();
|
||||
LuaConsole1.WaitOne();
|
||||
}
|
||||
|
||||
if (LuaConsole1.LuaImp.isRunning)
|
||||
if (LuaConsole1.IsRunning())
|
||||
{
|
||||
Global.MainForm.MainWait.Set();
|
||||
}
|
||||
|
|
|
@ -646,5 +646,27 @@ namespace BizHawk.MultiClient
|
|||
OpenLuaSession();
|
||||
}
|
||||
|
||||
public bool IsRunning()
|
||||
{
|
||||
if (!this.IsHandleCreated || this.IsDisposed)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (LuaImp.isRunning)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void WaitOne()
|
||||
{
|
||||
if (!this.IsHandleCreated || this.IsDisposed)
|
||||
return;
|
||||
|
||||
this.LuaImp.LuaWait.WaitOne();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue