[project @ 2000-04-10 16:49:15 by sewardj]
[ghc-hetmet.git] / ghc / rts / PrimOps.hc
index 709947a..94dc251 100644 (file)
@@ -1,7 +1,7 @@
 /* -----------------------------------------------------------------------------
- * $Id: PrimOps.hc,v 1.43 2000/02/28 13:59:43 simonmar Exp $
+ * $Id: PrimOps.hc,v 1.49 2000/03/21 11:33:12 rrt Exp $
  *
- * (c) The GHC Team, 1998-1999
+ * (c) The GHC Team, 1998-2000
  *
  * Primitive functions / data
  *
@@ -19,6 +19,8 @@
 #include "StablePriv.h"
 #include "HeapStackCheck.h"
 #include "StgRun.h"
+#include "Itimer.h"
+#include "Prelude.h"
 
 /* ** temporary **
 
@@ -903,7 +905,13 @@ FN_(putMVarzh_fast)
 #endif
 
   if (info == &FULL_MVAR_info) {
-    barf("putMVar#: MVar already full");
+#ifdef INTERPRETER
+    fprintf(stderr, "fatal: put on a full MVar in Hugs; aborting\n" );
+    exit(1);
+#else
+    R1.cl = (StgClosure *)PutFullMVar_closure;
+    JMP_(raisezh_fast);
+#endif
   }
   
   mvar->value = R2.cl;
@@ -1009,7 +1017,11 @@ FN_(delayzh_fast)
     /* Add on ticks_since_select, since these will be subtracted at
      * the next awaitEvent call.
      */
+#if defined(HAVE_SETITIMER) || defined(mingw32_TARGET_OS)
     CurrentTSO->block_info.delay = R1.i + ticks_since_select;
+#else
+    CurrentTSO->block_info.target = R1.i + getourtimeofday();
+#endif
 
     APPEND_TO_BLOCKED_QUEUE(CurrentTSO);