aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/SyncPlay
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2021-05-05 09:35:30 +0200
committerGitHub <noreply@github.com>2021-05-05 09:35:30 +0200
commit48e81e65e8948fa61980744932eb4103a28ed876 (patch)
tree8bb4d5d854609118b37a4e0073ef03e943c5357e /Emby.Server.Implementations/SyncPlay
parent52db719f506d36ddded8ef32e6d8f146e508cc15 (diff)
parentad3e835bcf7e800b483495af74adc36e10139be5 (diff)
Merge pull request #5938 from cvium/allocationz
Diffstat (limited to 'Emby.Server.Implementations/SyncPlay')
-rw-r--r--Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs13
1 files changed, 8 insertions, 5 deletions
diff --git a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
index 315277985c..72c0a838e2 100644
--- a/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
+++ b/Emby.Server.Implementations/SyncPlay/SyncPlayManager.cs
@@ -269,14 +269,17 @@ namespace Emby.Server.Implementations.SyncPlay
var user = _userManager.GetUserById(session.UserId);
List<GroupInfoDto> list = new List<GroupInfoDto>();
- foreach (var group in _groups.Values)
+ lock (_groupsLock)
{
- // Locking required as group is not thread-safe.
- lock (group)
+ foreach (var (_, group) in _groups)
{
- if (group.HasAccessToPlayQueue(user))
+ // Locking required as group is not thread-safe.
+ lock (group)
{
- list.Add(group.GetInfo());
+ if (group.HasAccessToPlayQueue(user))
+ {
+ list.Add(group.GetInfo());
+ }
}
}
}