Skip to content

Commit 77903de

Browse files
authored
Merge pull request #61065 from apple/rokhinip/92348139-actors-as-locks
[Freestanding] In the task-to-thread model, actors should behave like actual locks
2 parents ddd154b + ab16a64 commit 77903de

File tree

5 files changed

+370
-226
lines changed

5 files changed

+370
-226
lines changed

include/swift/Concurrency/Actor.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ enum : uint32_t {
5252
/// The actor is ready for deallocation once it stops running
5353
Zombie_ReadyForDeallocation = 0x3,
5454

55-
// Bit 3
56-
DistributedRemote = 0x8,
55+
// Bit 3 is free
56+
5757
// Bit 4
5858
IsPriorityEscalated = 0x10,
5959

include/swift/Reflection/ReflectionContext.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,8 @@ class ReflectionContext
203203
StoredPointer FirstJob;
204204

205205
uint8_t State;
206-
bool IsDistributedRemote;
207206
bool IsPriorityEscalated;
207+
bool IsDistributedRemote;
208208
uint8_t MaxPriority;
209209

210210
bool HasThreadPort;
@@ -1737,13 +1737,12 @@ class ReflectionContext
17371737

17381738
uint32_t Flags = ActorObj->Status.Flags[0];
17391739
Info.State = Flags & concurrency::ActorFlagConstants::ActorStateMask;
1740-
Info.IsDistributedRemote =
1741-
Flags & concurrency::ActorFlagConstants::DistributedRemote;
17421740
Info.IsPriorityEscalated =
17431741
Flags & concurrency::ActorFlagConstants::IsPriorityEscalated;
17441742
Info.MaxPriority =
17451743
(Flags & concurrency::ActorFlagConstants::PriorityMask) >>
17461744
concurrency::ActorFlagConstants::PriorityShift;
1745+
Info.IsDistributedRemote = ActorObj->IsDistributedRemote;
17471746

17481747
// Don't read FirstJob when idle.
17491748
if (Info.State != concurrency::ActorFlagConstants::Idle) {

include/swift/Reflection/RuntimeInternals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ struct DefaultActorImpl {
176176
HeapObject<Runtime> HeapObject;
177177
Job<Runtime> JobStorage;
178178
ActiveActorStatus Status;
179+
bool IsDistributedRemote;
179180
};
180181

181182
template <typename Runtime>

0 commit comments

Comments
 (0)