Thread-safe shared_ptr added

Change-Id: I473234f547e9aca3f14aaee7dd0c9edd528f8a84