function thread_switch

[edit]
static int thread_switch(int n)