[Fix] Timer doesn't work
Make sure the write thread waits for all polling threads