代码报错:标签'IL_1CF'不在goto语句的使用范围内~~~希望大神指教
private bool TryEnterWriteLockCore(ReaderWriterLockSlimer.TimeoutTracker timeout)
{
if (this.fDisposed)
{
throw new ObjectDisposedException(null);
}
int managedThreadId = Thread.CurrentThread.ManagedThreadId;
bool flag = false;
ReaderWriterCount threadRWCount;
if (!this.fIsReentrant)
{
if (managedThreadId == this.writeLockOwnerId)
{
throw new LockRecursionException("LockRecursionException_RecursiveWriteNotAllowed");
}
if (managedThreadId == this.upgradeLockOwnerId)
{
flag = true;
}
this.EnterMyLock();
threadRWCount = this.GetThreadRWCount(true);
if (threadRWCount != null && threadRWCount.readercount > 0)
{
this.ExitMyLock();
throw new LockRecursionException("LockRecursionException_WriteAfterReadNotAllowed");
}
}
else
{
this.EnterMyLock();
threadRWCount = this.GetThreadRWCount(false);
if (managedThreadId == this.writeLockOwnerId)
{
threadRWCount.writercount++;
this.ExitMyLock();
return true;
}
if (managedThreadId == this.upgradeLockOwnerId)
{
flag = true;
}
else
{
if (threadRWCount.readercount > 0)
{
this.ExitMyLock();
throw new LockRecursionException("LockRecursionException_WriteAfterReadNotAllowed");
}
}
}
int num = 0;
while (!this.IsWriterAcquired())
{
if (flag)
{
uint numReaders = this.GetNumReaders();
if (numReaders == 1u)
{
this.SetWriterAcquired();
}
else
{
if (numReaders != 2u || threadRWCount == null)
{
goto IL_131;
}
if (this.IsRwHashEntryChanged(threadRWCount))
{
threadRWCount = this.GetThreadRWCount(false);
}
if (threadRWCount.readercount <= 0)
{
goto IL_131;
}
this.SetWriterAcquired();
}
IL_1CF:
if (this.fIsReentrant)
{
if (this.IsRwHashEntryChanged(threadRWCount))
{
threadRWCount = this.GetThreadRWCount(false);
}
threadRWCount.writercount++;
}
this.ExitMyLock();
this.writeLockOwnerId = managedThreadId;
return true;
}
IL_131:
if (num < 20)
{
this.ExitMyLock();
if (timeout.IsExpired)
{
return false;
}
num++;
ReaderWriterLockSlimer.SpinWait(num);
this.EnterMyLock();
}
else
{
if (flag)
{
if (this.waitUpgradeEvent == null)
{
this.LazyCreateEvent(ref this.waitUpgradeEvent, true);
}
else
{
if (!this.WaitOnEvent(this.waitUpgradeEvent, ref this.numWriteUpgradeWaiters, timeout))
{
return false;
}
}
}
else
{
if (this.writeEvent == null)
{
this.LazyCreateEvent(ref this.writeEvent, true);
}
else
{
if (!this.WaitOnEvent(this.writeEvent, ref this.numWriteWaiters, timeout))
{
return false;
}
}
}
}
}
this.SetWriterAcquired();
goto IL_1CF;
}