Exemple #1
0
 public static EnterLeave section(MutexObject m)
 {
     return(new EnterLeave(delegate
     {
         m.waitForever();
     },
                           delegate
     {
         m.release();
     }));
 }
Exemple #2
0
        public static EnterLeave section(string name)
        {
            MutexObject m = new MutexObject(name);

            return(new EnterLeave(delegate
            {
                m.waitForever();
            },
                                  delegate
            {
                m.release();
                m.Dispose();
            }));
        }
Exemple #3
0
        public static EnterLeave deadSection(MutexObject m)
        {
            return(new EnterLeave(delegate
            {
                m.release();

                // app >

                Thread.Sleep(1);                 // context switching

                // < app
            },
                                  delegate
            {
                m.waitForever();
            }));
        }