+/*
+ * Routine: call_thread_block [private]
+ *
+ * Purpose: Hook via thread dispatch on
+ * the occasion of a callout blocking.
+ *
+ * Preconditions: splsched.
+ *
+ * Postconditions: None.
+ */
+
+void
+call_thread_block(void)
+{
+ simple_lock(&thread_call_lock);
+
+ if (--thread_call_vars.active_num < thread_call_vars.active_lowat)
+ thread_call_vars.active_lowat = thread_call_vars.active_num;
+
+ if ( thread_call_vars.active_num <= 0 &&
+ thread_call_vars.pending_num > 0 )
+ _call_thread_wake();
+
+ simple_unlock(&thread_call_lock);
+}
+
+/*
+ * Routine: call_thread_unblock [private]
+ *
+ * Purpose: Hook via thread wakeup on
+ * the occasion of a callout unblocking.
+ *
+ * Preconditions: splsched.
+ *
+ * Postconditions: None.
+ */
+
+void
+call_thread_unblock(void)
+{
+ simple_lock(&thread_call_lock);
+
+ if (++thread_call_vars.active_num > thread_call_vars.active_hiwat)
+ thread_call_vars.active_hiwat = thread_call_vars.active_num;
+
+ simple_unlock(&thread_call_lock);
+}