Beispiel #1
0
        void RunOperation(bool writeBack, RecentItemOperation operation)
        {
            lock (writerLock) {
                /*ObtainLock ();
                 * try {*/
                List <RecentItem> store = ReadStore(0);
                if (store != null)
                {
                    for (int i = 0; i < store.Count; ++i)
                    {
                        operation(store[i]);
                    }
                    if (writeBack)
                    {
                        WriteStore(store);
                    }
                }

                /*} finally {
                 *      ReleaseLock ();
                 * }*/
            }
        }
		void RunOperation (bool writeBack, RecentItemOperation operation)
		{
			lock (writerLock) {
			/*ObtainLock ();
			try {*/
				List<RecentItem> store = ReadStore (0);
				if (store != null) {
					for (int i = 0; i < store.Count; ++i) 
						operation (store[i]);
					if (writeBack) 
						WriteStore (store);
				}
			/*} finally {
				ReleaseLock ();
			}*/
			}
		}