File indexing completed on 2024-05-12 04:37:43

0001 /*
0002     SPDX-FileCopyrightText: 2007-2009 David Nolden <david.nolden.kdevelop@art-master.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef KDEVPLATFORM_URLPARSELOCK_H
0008 #define KDEVPLATFORM_URLPARSELOCK_H
0009 
0010 #include <language/languageexport.h>
0011 
0012 #include <serialization/indexedstring.h>
0013 
0014 namespace KDevelop {
0015 /**
0016  * This is used to prevent the background parser from updating the duchain for a specific file.
0017  * It can be used to prevent changes while working on the duchain.
0018  *
0019  * Every language-specific parse-job has to lock this before updating a TopDUContext.
0020  *
0021  * @warning No other mutex must be locked when this lock is acquired, to prevent deadlocks
0022  */
0023 class KDEVPLATFORMLANGUAGE_EXPORT UrlParseLock
0024 {
0025 public:
0026     explicit UrlParseLock(const IndexedString& url);
0027     ~UrlParseLock();
0028 
0029 private:
0030     Q_DISABLE_COPY(UrlParseLock)
0031 
0032     IndexedString m_url;
0033 };
0034 }
0035 
0036 #endif