示例#1
0
        public static void MyThreadProc(object o)
        {
            SynchronizedCache cache = (SynchronizedCache)o;

            cache.Add(4, "bar");
            cache.AddWithTimeout(5, "bar", 10);
            cache.Delete(3);
        }
示例#2
0
        public static void Main(string[] args)
        {
            SynchronizedCache cache    = new SynchronizedCache();
            Thread            myThread = new Thread(MyThreadProc);

            myThread.Start(cache);
            cache.AccessProperties();
            cache.Add(3, "foo");
            cache.AddWithTimeout(6, "bar", 10);
            cache.AddOrUpdate(3, "bar");
            myThread.Join();
        }