diff options
author | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-06-11 05:18:21 +0400 |
---|---|---|
committer | Gonzalo Paniagua Javier <gonzalo.mono@gmail.com> | 2004-06-11 05:18:21 +0400 |
commit | 50abbf1102584947a9c08daf7b59ff7bcc632ce4 (patch) | |
tree | b2171ac379376b99eb30e7c00433be40834573e9 /mcs/class/corlib/System.Threading | |
parent | e07f4c9ecf25b2d861096f1015baa044a1be7cea (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/ChangeLog | 6 | ||||
-rwxr-xr-x | mcs/class/corlib/System.Threading/Thread.cs | 9 |
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; } |