-
Notifications
You must be signed in to change notification settings - Fork 0
PosSharp.Core.AtomicState_TState_
github-actions[bot] edited this page May 8, 2026
·
3 revisions
Compare-And-Swap (CAS) ベースのアトミックな状態管理を提供します。
immutable な参照型と組み合わせることで、Lock を使用せずに スレッドセーフな状態遷移を実現します。
public sealed class AtomicState<TState>
where TState : classTState
状態の型。参照型に限定されます。
Inheritance System.Object 🡒 AtomicState<TState>
| Constructors | |
|---|---|
| AtomicState(TState) | AtomicState<TState> の新しいインスタンスを初期化します。 |
| Properties | |
|---|---|
| Current | 現在の状態を取得します。 |
| Methods | |
|---|---|
| Exchange(TState) | アトミックに状態を無条件で置換します。 |
| Transition(Func<TState,TState>) | アトミックに状態を遷移させます。 transform は CAS の競合時に複数回呼び出される可能性があるため、 副作用のない純粋関数である必要があります。 |
Expand / Collapse
- Interfaces
- Classes
- Events
- Enums & Constants
Expand / Collapse
- Lifecycle Management
- Base Components
- Exceptions
