Index: kernel/generic/src/proc/scheduler.c
===================================================================
--- kernel/generic/src/proc/scheduler.c	(revision 518dd43efcb2bc45690e83a1c9fed2130e46557b)
+++ kernel/generic/src/proc/scheduler.c	(revision ff90f5ff632907d5ecfca130f802b91bb0091a56)
@@ -52,4 +52,5 @@
 #include <atomic.h>
 #include <synch/spinlock.h>
+#include <synch/workqueue.h>
 #include <config.h>
 #include <context.h>
@@ -126,4 +127,5 @@
 static void after_thread_ran(void)
 {
+	workq_after_thread_ran();
 	after_thread_ran_arch();
 }
Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision 518dd43efcb2bc45690e83a1c9fed2130e46557b)
+++ kernel/generic/src/proc/thread.c	(revision ff90f5ff632907d5ecfca130f802b91bb0091a56)
@@ -46,4 +46,5 @@
 #include <synch/spinlock.h>
 #include <synch/waitq.h>
+#include <synch/workqueue.h>
 #include <cpu.h>
 #include <str.h>
@@ -260,4 +261,11 @@
 }
 
+/** Invoked right before thread_ready() readies the thread. thread is locked. */
+static void before_thread_is_ready(thread_t *thread)
+{
+	ASSERT(irq_spinlock_locked(&thread->lock));
+	workq_before_thread_is_ready(thread);
+}
+
 /** Make thread ready
  *
@@ -273,4 +281,6 @@
 	ASSERT(thread->state != Ready);
 
+	before_thread_is_ready(thread);
+	
 	int i = (thread->priority < RQ_COUNT - 1) ?
 	    ++thread->priority : thread->priority;
@@ -378,4 +388,6 @@
 	
 	thread->task = task;
+	
+	thread->workq = NULL;
 	
 	thread->fpu_context_exists = false;
