support thread-safe
Merge pull request #9 from guangbin79/thread-safe

support thread-safe