Convert synchronized
to use semaphores
#4284
Merged
synchronized
to use semaphores
#4284