Thread Safety Improvement

Signed-off-by: Alexander Ivannikov <Alexivan_91@hotmail.com>
Merge branch 'master' of https://github.com/Malow/NDYGFX