adding push_thread impl and pop_thread signature