modify cfs.c,use pthread to do