I am trying to call longjmp. Setjmp works, but longjmp gives me a type error.
void thread_start_threading(void)
{
setjmp(env);
dispatch();
current_thread->function(current_thread->arg);
}
And then later:
void thread_yield(void)
{
longjmp(env, 9);
return;
}
The error it gives me is warning: passing argument 1 of ‘longjmp’ makes pointer from integer without a cast
What I really want is to save the state of the registers and then restore them later. I don't think i need to use the argument to do that. But I could be wrong. I don't grok setjmp.
EDIT: More code