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:
authorIgor Zelmanovich <igorz@mono-cvs.ximian.com>2007-05-08 15:18:26 +0400
committerIgor Zelmanovich <igorz@mono-cvs.ximian.com>2007-05-08 15:18:26 +0400
commit082f8b20811c19d1c7857a7a9ae3a09cd82c06a6 (patch)
tree5305451ada3c09fe6da90c765102a8ce7e02147b /mcs/class/System/System.Diagnostics/TraceListener.cs
parent758612aea9eb259c3d0e6797e54ff0c87a43f5d1 (diff)
2007-05-08 Igor Zelmanovich <igorz@mainsoft.com>
* RBTree.cs: for TARGET_JVM used Thread Local Storage istead Thread-Relative Static Fields * TraceImpl.cs: * TraceListener.cs: for TARGET_JVM used Thread Local Storage istead Thread-Relative Static Fields svn path=/trunk/mcs/; revision=76917
Diffstat (limited to 'mcs/class/System/System.Diagnostics/TraceListener.cs')
-rw-r--r--mcs/class/System/System.Diagnostics/TraceListener.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/mcs/class/System/System.Diagnostics/TraceListener.cs b/mcs/class/System/System.Diagnostics/TraceListener.cs
index 88cec181ad5..6d9ebc8dac6 100644
--- a/mcs/class/System/System.Diagnostics/TraceListener.cs
+++ b/mcs/class/System/System.Diagnostics/TraceListener.cs
@@ -41,11 +41,36 @@ namespace System.Diagnostics {
public abstract class TraceListener : MarshalByRefObject, IDisposable {
+#if TARGET_JVM
+ readonly LocalDataStoreSlot _indentLevelStore = System.Threading.Thread.AllocateDataSlot ();
+ readonly LocalDataStoreSlot _indentSizeStore = System.Threading.Thread.AllocateDataSlot ();
+
+ private int indentLevel {
+ get {
+ object o = System.Threading.Thread.GetData (_indentLevelStore);
+ if (o == null)
+ return 0;
+ return (int) o;
+ }
+ set { System.Threading.Thread.SetData (_indentLevelStore, value); }
+ }
+
+ private int indentSize {
+ get {
+ object o = System.Threading.Thread.GetData (_indentSizeStore);
+ if (o == null)
+ return 4;
+ return (int) o;
+ }
+ set { System.Threading.Thread.SetData (_indentSizeStore, value); }
+ }
+#else
[ThreadStatic]
private int indentLevel = 0;
[ThreadStatic]
private int indentSize = 4;
+#endif
private string name = null;
private bool needIndent = true;