Vixen
dd8b0a81
csharp
public readonly struct JobAccessScope

The window in which every job this thread schedules carries one JobAccess.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A scope rather than a parameter on the four Schedule overloads, because the caller that knows the access and the caller that schedules the work are usually not the same one. The ECS is the case that decided it: the system runner knows what a system declared and brackets the call to its Update, and the system inside schedules whatever it likes without having to thread a declaration through code that does not care.

⚠ The scope belongs to the thread that opened it, and does not travel into the job. A job that schedules more jobs from a worker thread is scheduling them undeclared, and so unchecked. Nesting is fine: an inner scope replaces the outer one and Dispose puts it back.

Disposing twice, or disposing the default value, does nothing. In a build with SafetyChecksEnabled false the whole thing is a no-op that the jitter removes.

Methods (1)

  • public void Dispose()

    Puts back whatever declaration was in force before.

Used by (2)

  • JobSchedulerVixen.Core.Threading
  • SystemRunnerVixen.Ecs