Modify 'ready_dequeue' to return pointer to thread.