コード例 #1
0
        public void SaveDocument(Document document)
        {
            if (document == null)
            {
                return;
            }

            lock (syncLock)
            {
                docsProvider.SaveDocument(document);
            }
        }
コード例 #2
0
        public async Task SaveDocument(Document document)
        {
            if (document == null)
            {
                return;
            }

            mutex.WaitOne();
            try
            {
                await docsProvider.SaveDocument(document);
            }
            finally
            {
                mutex.ReleaseMutex();
            }
        }