Drivers.Framework.GC.ExitCritical()

Here are the examples of the csharp api class Drivers.Framework.GC.ExitCritical() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

1. Example

Project: FlingOS
Source File: GC.cs
[NoDebug]
        [NoGC]
        private static void AddObjectToCleanup(GCHeader* objHeaderPtr, void* objPtr)
        {
            EnterCritical("AddObjectToCleanup");

            try
            {
                ObjectToCleanup* newObjToCleanupPtr =
                    (ObjectToCleanup*)Heap.AllocZeroed((uint)sizeof(ObjectToCleanup), "GC : AddObjectToCleanup");
                newObjToCleanupPtr->objHeaderPtr = objHeaderPtr;
                newObjToCleanupPtr->objPtr = objPtr;

                if (CleanupList != null)
                {
                    newObjToCleanupPtr->prevPtr = CleanupList;
                    CleanupList->nextPtr = newObjToCleanupPtr;
                }
                else
                {
                    newObjToCleanupPtr->prevPtr = null;
                    newObjToCleanupPtr->nextPtr = null;
                }

                CleanupList = newObjToCleanupPtr;
            }
            finally
            {
                ExitCritical();
            }
        }

2. Example

Project: FlingOS
Source File: GC.cs
[NewObjMethod]
        [NoDebug]
        [NoGC]
        public static void* NewObj(Type theType)
   /n ..... /n //View Source file for more details /n }

3. Example

Project: FlingOS
Source File: GC.cs
[NewArrMethod]
        [NoDebug]
        [NoGC]
        public static void* NewArr(int length, Type /n ..... /n //View Source file for more details /n }

4. Example

Project: FlingOS
Source File: GC.cs
[NoDebug]
        [NoGC]
        public static void* NewString(int length)
        {
            if /n ..... /n //View Source file for more details /n }

5. Example

Project: FlingOS
Source File: GC.cs
[NoDebug]
        [NoGC]
        public static void Cleanup()
        {
            if (!Enabled /*|/n ..... /n //View Source file for more details /n }

6. Example

Project: FlingOS
Source File: GC.cs
[NoDebug]
        [NoGC]
        private static void RemoveObjectToCleanup(GCHeader* objHeaderPtr)
        {
            EnterCritical("RemoveObjectToCleanup");

            try
            {
                ObjectToCleanup* currObjToCleanupPtr = CleanupList;
                while (currObjToCleanupPtr != null)
                {
                    if (currObjToCleanupPtr->objHeaderPtr == objHeaderPtr)
                    {
                        RemoveObjectToCleanup(currObjToCleanupPtr);
                        return;
                    }
                    currObjToCleanupPtr = currObjToCleanupPtr->prevPtr;
                }
            }
            finally
            {
                ExitCritical();
            }
        }