Repository navigation
Replace CheapUnfairReaderWriterLock with ReaderWriterLockSlim - #136241
Conversation
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @SamMonoRT, @dotnet/efteam |
|
Oops, didn't know that MRES isn't supported on brower. Reverted back to use MRE |
Also switch it to ManualResetEventSlim and newer Lock type
83f69f0 to
2651cf2
Compare
Generate transaction hashes in table itself
|
Could you please update the PR description to match the final change? |
|
@jkotas Sure, done
|
There was a problem hiding this comment.
🟡 Changes recommended
The replacement lock rejects nested transaction creation from synchronous timer listeners, and concurrency validation remains outstanding.
1 open issue
What changed in this PR
This PR replaces the custom transaction-table lock with ReaderWriterLockSlim and separates transaction hash generation from lock bookkeeping.
Changes:
- Remove
CheapUnfairReaderWriterLockand use the standard reader/writer lock. - Generate transaction hashes using a dedicated counter incremented with
Interlocked.
Validation was limited to source inspection; no builds or tests were run.
| File | Description |
|---|---|
| src/libraries/System.Transactions.Local/src/System/Transactions/TransactionTable.cs | Replace the custom lock and introduce independent transaction hash generation. |
Review effort: Balanced

Replace CheapUnfairReaderWriterLock with ReaderWriterLockSlim.
Generate transaction hash in table via counter.