Is anyone familiar with ucontext?
I'm trying to use ucontext to create a thread library but I'm segfaulting. I'm using the debugger so I know what the problem is but I don't really understand why. Using debugger I can see that the ucontext_ptr2 in Thread struct is always 0. The ucontext_ptr that I declared in the method however, does get a value but I just put that in as a test so when I call getContext it fails.
int thread_create(thread_startfunc_t func, void *arg)
cout << "Creating Thread" << endl;
Thread* t = new Thread;
t->heldLock = -1;
t->blockedLock = -1;
t->cv = -1;