Skip to content

[Feature Request] Atomic properties #1253

Closed
@jtenner

Description

@jtenner

Proposed mechanism for this: @atomic decorator

Given the following class example:

class A {
  @atomic b: i32 = 0;
}

// should be the equivalent of writing the following code

class A {
  private _b: i32 = 0;
  public get b(): i32 {
   return atomic.load<i32>(changetype<usize>(this), offsetof<A>("_b"));
  }
  public set b(value: i32) {
   return atomic.store<i32>(changetype<usize>(this), value, offsetof<A>("_b"));
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions