Index: /trunk/include/iprt/thread.h
===================================================================
--- /trunk/include/iprt/thread.h	(revision 22613)
+++ /trunk/include/iprt/thread.h	(revision 22614)
@@ -484,4 +484,8 @@
     uint8_t         bReserved3;
 # define RTTHREADPREEMPTSTATE_INITIALIZER { NIL_RTCPUID, 255, 0, 0, 0 }
+#elif defined(RT_OS_SOLARIS)
+    /** The Old PIL. Don't touch! */
+    uint32_t        uOldPil;
+# define RTTHREADPREEMPTSTATE_INITIALIZER { NIL_RTCPUID, UINT32_MAX } 
 #else
     /** Reserved, MBZ. */
Index: /trunk/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c
===================================================================
--- /trunk/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c	(revision 22613)
+++ /trunk/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c	(revision 22614)
@@ -67,30 +67,5 @@
         cTicks = 0;
 
-#if 0
-    timeout = ddi_get_lbolt();
-    timeout += cTicks;
-
-    kcondvar_t cnd;
-    kmutex_t mtx;
-    mutex_init(&mtx, "IPRT Sleep Mutex", MUTEX_DRIVER, NULL);
-    cv_init(&cnd, "IPRT Sleep CV", CV_DRIVER, NULL);
-    mutex_enter(&mtx);
-    cv_timedwait (&cnd, &mtx, timeout);
-    mutex_exit(&mtx);
-    cv_destroy(&cnd);
-    mutex_destroy(&mtx);
-#endif
-
-#if 1
     delay(cTicks);
-#endif
-
-#if 0
-    /*   Hmm, no same effect as using delay() */
-    struct timespec t;
-    t.tv_sec = 0;
-    t.tv_nsec = cMillies * 1000000L;
-    nanosleep (&t, NULL);
-#endif
 
     return VINF_SUCCESS;
@@ -144,8 +119,8 @@
 {
     AssertPtr(pState);
-    Assert(pState->u32Reserved == 0);
-    pState->u32Reserved = 42;
-
+    Assert(pState->uOldPil == UINT32_MAX);
     kpreempt_disable();
+    pState->uOldPil = splr(ipltospl(LOCK_LEVEL - 1));
+    Assert(pState->uOldPil != UINT32_MAX);    
     RT_ASSERT_PREEMPT_CPUID_DISABLE(pState);
 }
@@ -155,9 +130,9 @@
 {
     AssertPtr(pState);
-    Assert(pState->u32Reserved == 42);
-    pState->u32Reserved = 0;
+    Assert(pState->uOldPil != UINT32_MAX);
     RT_ASSERT_PREEMPT_CPUID_RESTORE(pState);
-
+    splx(pState->uOldPil);    
     kpreempt_enable();
+    pState->uOldPil = UINT32_MAX;
 }
 
Index: /trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread-r0drv-solaris.c
===================================================================
--- /trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread-r0drv-solaris.c	(revision 22613)
+++ /trunk/src/VBox/Runtime/r0drv/solaris/vbi/thread-r0drv-solaris.c	(revision 22614)
@@ -116,7 +116,10 @@
 {
     AssertPtr(pState);
-    Assert(pState->u32Reserved == 0);
-    pState->u32Reserved = 42;
+    Assert(pState->uOldPil == UINT32_MAX);
+
     vbi_preempt_disable();
+
+    pState->uOldPil = splr(ipltospl(LOCK_LEVEL - 8));
+    Assert(pState->uOldPil != UINT32_MAX);
     RT_ASSERT_PREEMPT_CPUID_DISABLE(pState);
 }
@@ -126,8 +129,11 @@
 {
     AssertPtr(pState);
-    Assert(pState->u32Reserved == 42);
-    pState->u32Reserved = 0;
     RT_ASSERT_PREEMPT_CPUID_RESTORE(pState);
+    Assert(g_frtSolarisSplSetsEIF && pState->uOldPil != UINT32_MAX);
+    splx(pState->uOldPil);
+
     vbi_preempt_enable();
+
+    pState->uOldPil = UINT32_MAX;
 }
 
