unnested two locks in IScriptInstance