Merge "Add synchronized block when accessing global variables" into main