Removed active waiting loop which could block threads. Instead a separate thread to reorder the finished job is used.