未验证 提交 1b0d3c48 编写于 作者: S Sam Bent 提交者: GitHub

Merge pull request #3577 from SamBent/PredefinedPackageSynch

App resource threading issue
......@@ -700,7 +700,8 @@ public static StreamResourceInfo GetRemoteStream(Uri uriRemote)
SiteOfOriginContainer sooContainer = (SiteOfOriginContainer)GetResourcePackage(packageUri);
// the SiteOfOriginContainer is shared across threads; synchronize access to it
lock (_packageLock)
// using the same lock object as other uses (PackWebResponse+CachedResponse.GetResponseStream)
lock (sooContainer)
{
sooPart = sooContainer.GetPart(partUri) as SiteOfOriginPart;
}
......@@ -2017,8 +2018,9 @@ private static PackagePart GetResourceOrContentPart(Uri uri)
ResourceContainer resContainer = (ResourceContainer)GetResourcePackage(packageUri);
// the ResourceContainer is shared across threads; synchronize access to it
// using the same lock object as other uses (PackWebResponse+CachedResponse.GetResponseStream)
PackagePart part = null;
lock (_packageLock)
lock (resContainer)
{
part = resContainer.GetPart(partUri);
}
......@@ -2417,7 +2419,6 @@ private object RunDispatcher(object ignore)
static private bool _appCreatedInThisAppDomain;
static private Application _appInstance;
static private Assembly _resourceAssembly;
static private object _packageLock = new Object();
// Keep LoadBamlSyncInfo stack so that the Outer LoadBaml and Inner LoadBaml( ) for the same
// Uri share the related information.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册