public void ParallelAddOffsetsValue()
        {
            using (NativePerJobThreadLongPtr longPtr = new NativePerJobThreadLongPtr(
                       Allocator.Temp,
                       123))
            {
                NativePerJobThreadLongPtr.Parallel parallel = longPtr.GetParallel();
                parallel.Add(5);

                Assert.That(longPtr.Value, Is.EqualTo(128));

                parallel.Add(-15);

                Assert.That(longPtr.Value, Is.EqualTo(113));
            }
        }
 public void ParallelAddRequiresReadAccess()
 {
     using (NativePerJobThreadLongPtr longPtr = new NativePerJobThreadLongPtr(
                Allocator.Temp))
     {
         NativePerJobThreadLongPtr.Parallel parallel = longPtr.GetParallel();
         AssertRequiresReadOrWriteAccess(
             longPtr,
             () => parallel.Add(10));
     }
 }
 public void Execute(int index)
 {
     Sum.Add(Array[index]);
 }