Added context switching primitives.