Skip to content

Commit a2cab93

Browse files
committed
Use System.Threading.Lock under .NET 9.0.
1 parent cf952ed commit a2cab93

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/MySqlConnector/Core/ServerSession.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,11 @@ protected override void OnStatementBegin(int index)
21532153
private static readonly PayloadData s_selectConnectionIdVersionWithAttributesPayload = QueryPayload.Create(true, "SELECT CONNECTION_ID(), VERSION();"u8);
21542154

21552155
private readonly ILogger m_logger;
2156+
#if NET9_0_OR_GREATER
2157+
private readonly Lock m_lock;
2158+
#else
21562159
private readonly object m_lock;
2160+
#endif
21572161
private readonly ArraySegmentHolder<byte> m_payloadCache;
21582162
private readonly ActivityTagsCollection m_activityTags;
21592163
private State m_state;

0 commit comments

Comments
 (0)