mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-20 08:58:00 +02:00
Thread protection for project cache
This commit is contained in:
parent
c58e30e005
commit
41858b3dc5
1 changed files with 41 additions and 32 deletions
|
@ -756,13 +756,18 @@ namespace IDE
|
|||
}
|
||||
|
||||
public void ClearProjectNameCache()
|
||||
{
|
||||
using (mMonitor.Enter())
|
||||
{
|
||||
for (var key in mProjectNameMap.Keys)
|
||||
delete key;
|
||||
mProjectNameMap.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
public void AddProjectToCache(Project project)
|
||||
{
|
||||
using (mMonitor.Enter())
|
||||
{
|
||||
void Add(String name, Project project)
|
||||
{
|
||||
|
@ -778,8 +783,11 @@ namespace IDE
|
|||
for (var alias in project.mGeneralOptions.mAliases)
|
||||
Add(alias, project);
|
||||
}
|
||||
}
|
||||
|
||||
public Project FindProject(StringView projectName)
|
||||
{
|
||||
using (mMonitor.Enter())
|
||||
{
|
||||
if (mProjectNameMap.IsEmpty)
|
||||
{
|
||||
|
@ -806,6 +814,7 @@ namespace IDE
|
|||
{
|
||||
return value;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue