示例#1
0
        internal static SRes Semaphore_Release1(CSemaphore p)
        {
#if !DISABLE_TRACE
            Trace.MatchObjectWait(p, "Semaphore_Release");
#else
            p.Semaphore.Release();
#endif
            return(TSZ("Semaphore_Release"));
        }
示例#2
0
        internal static void Semaphore_Close(ref CSemaphore p)
        {
            if (p != null)
            {
                p.Semaphore.Close();
            }

            p = null;
        }
示例#3
0
        internal static SRes Semaphore_Create(out CSemaphore p, uint initCount, uint maxCount)
        {
            p = new CSemaphore();
#if !DISABLE_TRACE
            Trace.MatchObjectCreate(p, "Semaphore_Create");
            Trace.Match((int)initCount, (int)maxCount);
#else
            p.Semaphore = new System.Threading.Semaphore(checked ((int)initCount), checked ((int)maxCount));
#endif
            return(TSZ("Semaphore_Create"));
        }
示例#4
0
        internal static void Semaphore_Close(ref CSemaphore p)
        {
            if (p != null)
            {
#if !DISABLE_TRACE
                Trace.MatchObjectDestroy(p, "Semaphore_Close");
#elif BUILD_PORTABLE
                p.Semaphore.Dispose();
#else
                p.Semaphore.Close();
#endif
            }

            p = null;
        }
示例#5
0
 internal static SRes Semaphore_Release1(CSemaphore p)
 {
     p.Semaphore.Release();
     return(TSZ("Semaphore_Release"));
 }
示例#6
0
 internal static SRes Semaphore_Create(out CSemaphore p, uint initCount, uint maxCount)
 {
     p           = new CSemaphore();
     p.Semaphore = new System.Threading.Semaphore(checked ((int)initCount), checked ((int)maxCount));
     return(TSZ("Semaphore_Create"));
 }
示例#7
0
 internal static SRes Semaphore_Wait(CSemaphore p)
 {
     p.Semaphore.WaitOne();
     return(TSZ("Semaphore_Wait"));
 }
示例#8
0
 internal static void Semaphore_Construct(out CSemaphore p)
 {
     p = null;
 }
示例#9
0
 internal static SRes Semaphore_Wait(CSemaphore p)
 {
     #if !DISABLE_TRACE
     Trace.MatchObjectWait(p, "Semaphore_Wait");
     #else
     p.Semaphore.WaitOne();
     #endif
     return TSZ("Semaphore_Wait");
 }
示例#10
0
 internal static SRes Semaphore_Create(out CSemaphore p, uint initCount, uint maxCount)
 {
     p = new CSemaphore();
     #if !DISABLE_TRACE
     Trace.MatchObjectCreate(p, "Semaphore_Create");
     Trace.Match((int)initCount, (int)maxCount);
     #else
     p.Semaphore = new System.Threading.Semaphore(checked((int)initCount), checked((int)maxCount));
     #endif
     return TSZ("Semaphore_Create");
 }
示例#11
0
 internal static void Semaphore_Construct(out CSemaphore p)
 {
     p = null;
 }
示例#12
0
        internal static void Semaphore_Close(ref CSemaphore p)
        {
            if (p != null)
            {
            #if !DISABLE_TRACE
                Trace.MatchObjectDestroy(p, "Semaphore_Close");
            #else
                p.Semaphore.Close();
            #endif
            }

            p = null;
        }