public void NativeBitArray_ParallelReader() { var numBits = 256; var reader = new NativeBitArray(numBits, Allocator.Persistent, NativeArrayOptions.ClearMemory); reader.Set(7, true); var readerJob = new NativeBitArrayTestParallelReader { reader = reader }.Schedule(); reader.Dispose(readerJob); readerJob.Complete(); }
public void NativeBitArray_ParallelReader() { var numBits = 256; var reader = new NativeBitArray(numBits, Allocator.Persistent, NativeArrayOptions.ClearMemory); reader.Set(7, true); var readerJob = new NativeBitArrayTestParallelReader { reader = reader }.Schedule(); var from = new NativeBitArray(numBits, Allocator.Persistent, NativeArrayOptions.ClearMemory); Assert.Throws <InvalidOperationException>(() => { reader.Copy(7, ref from, 30, 10); } /* attempt to write into reader after job is scheduled */); from.Dispose(); reader.Dispose(readerJob); readerJob.Complete(); }