Exemple #1
0
        static void Main(string[] args)
        {
            SomeClass      object1 = new SomeClass();
            SomeOtherClass object2 = new SomeOtherClass();

            object1.Setother(object2);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            SomeOtherClass object2 = new SomeOtherClass();

            lock (object2)
            {
                ohoh(object2);
                GC.Collect();
                //GC.WaitForPendingFinalizers();
                Console.WriteLine("OK let's release lock in Main");
            }

            Console.WriteLine("Are we here");
        }
Exemple #3
0
 public void Setother(SomeOtherClass otherObject)
 {
     other = otherObject;
 }
Exemple #4
0
        private static void ohoh(SomeOtherClass obj)
        {
            SomeClass object1 = new SomeClass();

            object1.Setother(obj);
        }