Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
No need to support recursion, also lock when we get _list.Count
  • Loading branch information
abessen committed Oct 28, 2016
commit 6838be81c7beebed564c02f277e6ec33cbae697c
16 changes: 14 additions & 2 deletions src/runtime/assemblymanager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -488,10 +488,22 @@ private class AssemblyList : IEnumerable<Assembly>{

public AssemblyList(int capacity) {
_list = new List<Assembly>(capacity);
_lock = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
_lock = new ReaderWriterLockSlim();
}

public int Count { get { return _list.Count; } }
public int Count
{
get
{
_lock.EnterReadLock();
try {
return _list.Count;
}
finally {
_lock.ExitReadLock();
}
}
}

public void Add(Assembly assembly) {
_lock.EnterWriteLock();
Expand Down