Hi,
First i want to say thanks to gm developpers for this huge work, i'm using it for weeks and it's really perfect.
I think i may have found a little bug with the endon feature, (I'm using gm 1.29.0):
The main idea is when a endon block is reached, it creates a new "fake" block to kill the thread on a specific signal.
But I think that if this thread reaches after the endon, a real block (block, not endon), then it cancels the previous endon(s).
I wasn't able to recreate this with a small script (maybe because endon doesn't always return GM_SYS_BLOCK), but with my main script, i got this bug.
So i checked the gmMachineLib.cpp file, and i saw that a "block" return GM_SYS_BLOCK
such a return causes a machine->Sys_SwitchState(this,BLOCKED) (in gmThread.cpp/gmThread::PushStackFrame) ->
http://prntscr.com/37t3qzthen in Sys_SwitchState, for the case BLOCKED, it does Sys_RemoveBlocks(a_thread) ->
http://prntscr.com/37t4dbTherefore a block will remove a previous endon.
A fix, would be to not remove endon "blocks" in Sys_RemoveBlocks.
Am I right here ?
Thanks
Edit:
- Also I had a little question about "Sys_Signal", can I use GM_INVALID_THREAD for dest_thread and src_thread (as I want to send a signal from C++ code directly)
In the doc, it says that we can use GM_INVALID_THREAD for the dest_thread (this way all threads are signalled, but it says nothing about src_thread)
- In that case, if I create a signal from C++ code (not from a binding), can the object in the signal be collected by the GC ? because it's not really handled by the script, or is any object in a signal and a block not collected until the signal/block is "Sys_remove"?