fix runtime exception when create directory

due to multi-threads request make directory operations.
change to synchronizedly process make directory request
code cleanup
code cleanup
Merge pull request #111 from Logan676/lg2

fix runtime exception when create directory