Added the synchronized.

Write javadoc.