using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using System.Threading;
using System.Runtime.Remoting.Contexts;


namespace Zadanie_3
{
    [Synchronization]
    public class Klasa : ContextBoundObject
    {
        public void Metoda()
        {
            Console.WriteLine("Początek: " + Thread.CurrentThread.ManagedThreadId);
            Thread.Sleep(1000);
            Console.WriteLine("Koniec: " + Thread.CurrentThread.ManagedThreadId);
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            Klasa obiekt = new Klasa();            
            new Thread(obiekt.Metoda).Start();
            new Thread(obiekt.Metoda).Start();
            obiekt.Metoda();
        }
    }
}
