mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Make bundle item queries thread safe
Note though that mutating the bundle item index is not allowed if other threads are querying it.
This commit is contained in:
@@ -237,6 +237,9 @@ namespace parse
|
||||
|
||||
grammar_ptr parse_grammar (bundles::item_ptr const& grammarItem)
|
||||
{
|
||||
static std::recursive_mutex Mutex;
|
||||
std::lock_guard<std::recursive_mutex> lock(Mutex);
|
||||
|
||||
static std::map<oak::uuid_t, grammar_ptr> Cache;
|
||||
injected_grammars(); // ensure these are loaded in the main thread
|
||||
|
||||
|
||||
Reference in New Issue
Block a user