Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Remove IncrementPendingCallback from MARS sync reads #28427

Merged
merged 2 commits into from
Mar 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ private void ResetCancelAndProcessAttention()

internal abstract bool IsPacketEmpty(object readPacket);

internal abstract object ReadSyncOverAsync(int timeoutRemaining, bool isMarsOn, out uint error);
internal abstract object ReadSyncOverAsync(int timeoutRemaining, out uint error);

internal abstract object ReadAsync(out uint error, ref object handle);

Expand Down Expand Up @@ -2079,7 +2079,7 @@ internal void ReadSniSyncOverAsync()
Interlocked.Increment(ref _readingCount);
shouldDecrement = true;

readPacket = ReadSyncOverAsync(GetTimeoutRemaining(), false, out error);
readPacket = ReadSyncOverAsync(GetTimeoutRemaining(), out error);

Interlocked.Decrement(ref _readingCount);
shouldDecrement = false;
Expand Down Expand Up @@ -2520,7 +2520,7 @@ private void ReadSniError(TdsParserStateObject stateObj, UInt32 error)
Interlocked.Increment(ref _readingCount);
shouldDecrement = true;

syncReadPacket = ReadSyncOverAsync(stateObj.GetTimeoutRemaining(), _parser.MARSOn, out error);
syncReadPacket = ReadSyncOverAsync(stateObj.GetTimeoutRemaining(), out error);

Interlocked.Decrement(ref _readingCount);
shouldDecrement = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,13 @@ protected override void FreeGcHandle(int remaining, bool release)

internal override bool IsFailedHandle() => _sessionHandle.Status != TdsEnums.SNI_SUCCESS;

internal override object ReadSyncOverAsync(int timeoutRemaining, bool isMarsOn, out uint error)
internal override object ReadSyncOverAsync(int timeoutRemaining, out uint error)
{
SNIHandle handle = Handle;
if (handle == null)
{
throw ADP.ClosedConnectionError();
}
if (isMarsOn)
{
IncrementPendingCallbacks();
}
SNIPacket packet = null;
error = SNIProxy.Singleton.ReadSyncOverAsync(handle, out packet, timeoutRemaining);
return packet;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ protected override void FreeGcHandle(int remaining, bool release)

internal override bool IsFailedHandle() => _sessionHandle.Status != TdsEnums.SNI_SUCCESS;

internal override object ReadSyncOverAsync(int timeoutRemaining, bool isMarsOn, out uint error)
internal override object ReadSyncOverAsync(int timeoutRemaining, out uint error)
{
SNIHandle handle = Handle;
if (handle == null)
Expand Down