handbook: updated context switch example code