Hi,
Are you building a ndll? Looking over the code again, you should be able to do this with the CFFI.h functions:
// Called from thread....
int top = 0;
gc_set_top_of_stack(&top, true);
gc_exit_blocking();
.. haxe calls here ...
gc_enter_blocking()
// back to native work..
The " gc_set_top_of_stack" will register the thread for you, however it will currently leak the thread context, since there is no good way to unregister the thread.
The last parameter to "gc_set_top_of_stack" says that there are no haxe values on the stack at this point in time. So use true if you will not nest these calls, or false to be safe.
This is not really tested, but let me know how you go, and I will look to improve the API.