thread and c_thread working