Add missing forward declaration
Use c++11 mutex for synchronization
Fix visual studio project