What is synchronized modifier used for

It is used to control access of critical code in multithreaded programs