[System.Security.SecuritySafeCritical] // auto-generated static public StringMaker GetSharedStringMaker() { StringMaker maker = null; bool tookLock = false; try { Monitor.Enter(_sharedStatics, ref tookLock); if (_sharedStatics._maker != null) { maker = _sharedStatics._maker; _sharedStatics._maker = null; } } finally { if (tookLock) { Monitor.Exit(_sharedStatics); } } if (maker == null) { maker = new StringMaker(); } return(maker); }
[System.Security.SecuritySafeCritical] // auto-generated static public void ReleaseSharedStringMaker(ref StringMaker maker) { // save this stringmaker so someone else can use it bool tookLock = false; try { Monitor.Enter(_sharedStatics, ref tookLock); _sharedStatics._maker = maker; maker = null; } finally { if (tookLock) { Monitor.Exit(_sharedStatics); } } }