As general rule, using sleep as synchronization method is a bad idea.