* Add a lwkt_setpri_initial() call which has no cpu restriction but which
requires the thread to not be scheduled.
crit_exit();
}
+/*
+ * Set the initial priority for a thread prior to it being scheduled for
+ * the first time. The thread MUST NOT be scheduled before or during
+ * this call. The thread may be assigned to a cpu other then the current
+ * cpu.
+ *
+ * Typically used after a thread has been created with TDF_STOPPREQ,
+ * and before the thread is initially scheduled.
+ */
+void
+lwkt_setpri_initial(thread_t td, int pri)
+{
+ KKASSERT(pri >= 0);
+ KKASSERT((td->td_flags & TDF_RUNQ) == 0);
+ td->td_pri = (td->td_pri & ~TDPRI_MASK) + pri;
+}
+
void
lwkt_setpri_self(int pri)
{
extern lwkt_token_t lwkt_token_pool_get(void *);
extern void lwkt_setpri(thread_t, int);
+extern void lwkt_setpri_initial(thread_t, int);
extern void lwkt_setpri_self(int);
extern int lwkt_check_resched(thread_t);
extern void lwkt_setcpu_self(struct globaldata *);