Example #1
0
        public unsafe static void CheckReadAndThrow(AtomicSafetyHandle handle)
        {
            AtomicSafetyHandleVersionMask *ptr = (AtomicSafetyHandleVersionMask *)((void *)handle.versionNode);

            if ((handle.version & AtomicSafetyHandleVersionMask.Read) == (AtomicSafetyHandleVersionMask)0 && handle.version != (*ptr & AtomicSafetyHandleVersionMask.WriteInv))
            {
                AtomicSafetyHandle.CheckReadAndThrowNoEarlyOut(handle);
            }
        }
Example #2
0
        public unsafe static void CheckReadAndThrow(AtomicSafetyHandle handle)
        {
            int *ptr  = (int *)((void *)handle.versionNode);
            bool flag = handle.version != (*ptr & -7);

            if (flag)
            {
                AtomicSafetyHandle.CheckReadAndThrowNoEarlyOut(handle);
            }
        }