[M3devel] solaris RTThread__Transfer?

Jay jay.krell at cornell.edu
Sun Feb 1 15:11:07 CET 2009


SOLgnu/SOLsun have this:

void RTThread__Transfer (ucontext_t *from, ucontext_t *to)
{
  if (getcontext(from) == 0) {
    to->uc_mcontext.gregs[REG_O0] = (greg_t)1; /* emulate longjmp return */
    setcontext(to);  /* fire it up */
  }
}

Two questions:
 The longjmp emulation is unnecessary, right? (and platform specific) 
 getcontext + setcontext could just be swapcontext, right?
 

Specifically, the "entire function" could "just" be: (yeah yeah, only a slight reduction).
 

void RTThread__Transfer (ucontext_t *from, ucontext_t *to)
{
  swapcontext(from, to);
}
 

or even
 

RTThread.i3
 PROCEDURE Transfer(...);
 

Yes, I notice the error checking, but a) why would it ever fail b) is that really complete anyway?
Just silently ignore the error?
 

?
 - Jay


More information about the M3devel mailing list