1. Add atomic_counter
2. fix some compile error