Also improve the original synchronization logic. As requested [here](https://github.com/dotnet/runtime/pull/50802#issuecomment-814792435) and [here](https://github.com/dotnet/runtime/pull/50802#discussion_r608656867). Also address [this comment](https://github.com/dotnet/runtime/pull/51151#discussion_r612020237).