| View previous topic :: View next topic |
| Author |
Message |
Csimbi I post too much
Reputation: 98
Joined: 14 Jul 2007 Posts: 3384
|
Posted: Fri May 08, 2026 11:26 am Post subject: CheckSynchonize called from non-main thread |
|
|
This is the code I have at the top of an AA script:
| Code: | [ENABLE]
{$lua}
if syntaxcheck then return end
if process == nil then ShowMessage('Process is not selected.')
elseif readInteger(process) == 0 then ShowMessage('Process cannot be opened. Gone?')
else
if (monopipe~=nil) and (monopipe.ProcessID~=getOpenedProcessID()) then
monopipe.destroy()
monopipe=nil
end
if (monopipe==nil) then
LaunchMonoDataCollector()
-- monoSymbolList is only available if the target is il2cpp and not normal mono
while (monoSymbolList==nil) or (not monoSymbolList.FullyLoaded) do checkSynchronize(50) end -- checkSynchronize requires that memRec is ASynch.
end
end
{$asm} |
The memrec with script is set to 'Execute asynchronous".
When I execute the script, I get this error:
| Code: | | <<CheckSynchonize called from non-main thread "$9F0">> |
Any suggestions?
Thank you!
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 474
Joined: 09 May 2003 Posts: 25929 Location: The netherlands
|
Posted: Fri May 08, 2026 12:14 pm Post subject: |
|
|
| Quote: |
checkSynchronize requires that memRec is ASynch.
|
That is wrong. checkSynchronize may never be called inside an async thread
| Code: |
while (monoSymbolList==nil) or (not monoSymbolList.FullyLoaded) do
if inMainThread() then
checkSynchronize(50)
else
sleep(50)
end
end
|
_________________
Tools give you results. Knowledge gives you control.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 98
Joined: 14 Jul 2007 Posts: 3384
|
Posted: Fri May 08, 2026 3:34 pm Post subject: |
|
|
Seems I misinterpreted something.
Works great, thank you!
Thank you!
|
|
| Back to top |
|
 |
Csimbi I post too much
Reputation: 98
Joined: 14 Jul 2007 Posts: 3384
|
Posted: Mon May 11, 2026 5:14 am Post subject: |
|
|
There must be a bug here.
When I disable the script and I enable it a second time (mono is active on IL2CPP), I get this error:
| Code: | <<Lua error in the script at line 8:...\CEBETA\autorun\monoscript.lua:53: attempt to call a nil value (global 'synchronze')>>
| If, after this, I try to enable it a third time, CE starts flooding the LUA log with this message (and CE must be killed to stop this):
| Code: | | Error:Access violation |
The second line in this snippet is line 53 in monoscript.lua:
| Code: | if inMainThread()==false then
synchronze(function()
messageDialog(translate('Do not call libmono.terminate from external threads'), mtError, mbOK)
end)
end |
Is there a typo here with the 'i' missing?
Searched all files - the string 'synchronze' was not found anywhere else.
|
|
| Back to top |
|
 |
|