Shuffle order of code in invnetory connector GetFolderContent() calls to avoid a possible race condition
parent
42f1b88eb2
commit
8fb3e71b14
|
@ -185,15 +185,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
|
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
|
||||||
{
|
{
|
||||||
InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID);
|
InventoryCollection invCol = m_InventoryService.GetFolderContent(userID, folderID);
|
||||||
Util.FireAndForget(delegate
|
|
||||||
{
|
|
||||||
if (UserManager != null)
|
if (UserManager != null)
|
||||||
{
|
{
|
||||||
// Protect ourselves against the caller subsequently modifying the items list
|
// Protect ourselves against the caller subsequently modifying the items list
|
||||||
foreach (InventoryItemBase item in new List<InventoryItemBase>(invCol.Items))
|
List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items);
|
||||||
|
|
||||||
|
Util.FireAndForget(delegate
|
||||||
|
{
|
||||||
|
foreach (InventoryItemBase item in items)
|
||||||
UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
|
UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return invCol;
|
return invCol;
|
||||||
}
|
}
|
||||||
|
|
|
@ -193,15 +193,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||||
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
|
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
|
||||||
{
|
{
|
||||||
InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID);
|
InventoryCollection invCol = m_RemoteConnector.GetFolderContent(userID, folderID);
|
||||||
Util.FireAndForget(delegate
|
|
||||||
{
|
|
||||||
if (UserManager != null)
|
if (UserManager != null)
|
||||||
{
|
{
|
||||||
// Protect ourselves against the caller subsequently modifying the items list
|
// Protect ourselves against the caller subsequently modifying the items list
|
||||||
foreach (InventoryItemBase item in new List<InventoryItemBase>(invCol.Items))
|
List<InventoryItemBase> items = new List<InventoryItemBase>(invCol.Items);
|
||||||
|
|
||||||
|
Util.FireAndForget(delegate
|
||||||
|
{
|
||||||
|
foreach (InventoryItemBase item in items)
|
||||||
UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
|
UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData);
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return invCol;
|
return invCol;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue