Fixed tests and improve multithread sync #9

Merged
andrey merged 2 commits from atomic into master 2020-07-08 15:36:37 +03:00