Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2004-06-11 05:18:21 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2004-06-11 05:18:21 +0400
commit50abbf1102584947a9c08daf7b59ff7bcc632ce4 (patch)
treeb2171ac379376b99eb30e7c00433be40834573e9 /mcs/class/corlib/System.Threading
parente07f4c9ecf25b2d861096f1015baa044a1be7cea (diff)
2004-06-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
* Thread.cs: (CurrentPrincipal): lock on CurrentThread, not typeof (Thread) and set the thread IPrincipal if we get it from the AppDomain. svn path=/trunk/mcs/; revision=29247
Diffstat (limited to 'mcs/class/corlib/System.Threading')
-rw-r--r--mcs/class/corlib/System.Threading/ChangeLog6
-rwxr-xr-xmcs/class/corlib/System.Threading/Thread.cs9
2 files changed, 12 insertions, 3 deletions
diff --git a/mcs/class/corlib/System.Threading/ChangeLog b/mcs/class/corlib/System.Threading/ChangeLog
index 3a81638d822..f1e94b9d3a3 100644
--- a/mcs/class/corlib/System.Threading/ChangeLog
+++ b/mcs/class/corlib/System.Threading/ChangeLog
@@ -1,3 +1,9 @@
+2004-06-11 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Thread.cs:
+ (CurrentPrincipal): lock on CurrentThread, not typeof (Thread) and set
+ the thread IPrincipal if we get it from the AppDomain.
+
2004-06-09 Gert Driesen <drieseng@users.sourceforge.net>
* CompressedStack.cs: Added finalizer to match public API of
diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs
index d05639d9bfc..685154921cf 100755
--- a/mcs/class/corlib/System.Threading/Thread.cs
+++ b/mcs/class/corlib/System.Threading/Thread.cs
@@ -61,10 +61,13 @@ namespace System.Threading
public static IPrincipal CurrentPrincipal {
get {
IPrincipal p = null;
- lock (typeof (Thread)) {
- p = CurrentThread._principal;
- if (p == null)
+ Thread th = CurrentThread;
+ lock (th) {
+ p = th._principal;
+ if (p == null) {
p = GetDomain ().DefaultPrincipal;
+ th._principal = p;
+ }
}
return p;
}