Merge "Use volatile keyword instead of lock" into tm-dev