--- pth_uctx.c 2004/07/13 10:50:49 1.3
+++ pth_uctx.c 2004/12/03 16:21:08 1.4
@@ -97,7 +97,7 @@
/* switch to successor user-space context */
if (ctx.uctx_after != NULL)
- pth_uctx_restore(ctx.uctx_after);
+ pth_mctx_restore(&(ctx.uctx_after->uc_mctx));
/* terminate process (the only reasonable thing to do here) */
exit(0);
@@ -150,7 +150,7 @@
sigprocmask(SIG_SETMASK, sigmask, &ss);
/* perform the trampoline step */
- pth_mctx_switch(&mctx_parent, &uctx->uc_mctx);
+ pth_mctx_switch(&mctx_parent, &(uctx->uc_mctx));
/* optionally restore original signal mask */
if (sigmask != NULL)
@@ -162,39 +162,6 @@
return TRUE;
}
-/* save current user-space context */
-int
-pth_uctx_save(
- pth_uctx_t uctx)
-{
- /* argument sanity checking */
- if (uctx == NULL)
- return pth_error(FALSE, EINVAL);
-
- /* save underlying machine context */
- pth_mctx_save(&uctx->uc_mctx);
- uctx->uc_mctx_set = TRUE;
-
- return TRUE;
-}
-
-/* restore current user-space context */
-int
-pth_uctx_restore(
- pth_uctx_t uctx)
-{
- /* argument sanity checking */
- if (uctx == NULL)
- return pth_error(FALSE, EINVAL);
- if (!(uctx->uc_mctx_set))
- return pth_error(FALSE, EPERM);
-
- /* restore underlying machine context */
- pth_mctx_restore(&uctx->uc_mctx);
-
- return TRUE;
-}
-
/* switch from current to other user-space context */
int
pth_uctx_switch(
@@ -209,7 +176,7 @@
/* switch underlying machine context */
uctx_from->uc_mctx_set = TRUE;
- pth_mctx_switch(&uctx_from->uc_mctx, &uctx_to->uc_mctx);
+ pth_mctx_switch(&(uctx_from->uc_mctx), &(uctx_to->uc_mctx));
return TRUE;
}
|