Add synchronize to thread notify