Merge "Fix lock ordering bug due to use of reentrant lock."