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:
Diffstat (limited to 'mcs/class/corlib/System.Threading')
-rw-r--r--mcs/class/corlib/System.Threading/ChangeLog12
-rwxr-xr-xmcs/class/corlib/System.Threading/Thread.cs25
-rwxr-xr-xmcs/class/corlib/System.Threading/Timer.cs5
3 files changed, 13 insertions, 29 deletions
diff --git a/mcs/class/corlib/System.Threading/ChangeLog b/mcs/class/corlib/System.Threading/ChangeLog
index d6236617956..ba1a9664f98 100644
--- a/mcs/class/corlib/System.Threading/ChangeLog
+++ b/mcs/class/corlib/System.Threading/ChangeLog
@@ -1,15 +1,3 @@
-2004-08-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
-
- * Timer.cs: don't invoke the callback if the period changes before the
- due time. Fixes bug #62421.
-
-2004-07-15 Dick Porter <dick@ximian.com>
-
- * Thread.cs: Hold a lock in GetNamedDataSlot. Fixes bug 61582,
- based on patch by Sébastien Robitaille
- (sebastien.robitaille@croesus.com). Also fix instances of
- lock(typeof(Thread)) to lock a private object instead.
-
2004-06-24 Dick Porter <dick@ximian.com>
* Mutex.cs: Implement the createdNew parameter
diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs
index 911fb1dbe12..66826e12d40 100755
--- a/mcs/class/corlib/System.Threading/Thread.cs
+++ b/mcs/class/corlib/System.Threading/Thread.cs
@@ -157,10 +157,9 @@ namespace System.Threading
// Stores a hash keyed by strings of LocalDataStoreSlot objects
static Hashtable datastorehash;
- private static object datastore_lock = new object ();
-
+
private static void InitDataStoreHash () {
- lock (datastore_lock) {
+ lock (typeof (Thread)) {
if (datastorehash == null) {
datastorehash = Hashtable.Synchronized(new Hashtable());
}
@@ -168,7 +167,7 @@ namespace System.Threading
}
public static LocalDataStoreSlot AllocateNamedDataSlot(string name) {
- lock (datastore_lock) {
+ lock (typeof (Thread)) {
if (datastorehash == null)
InitDataStoreHash ();
LocalDataStoreSlot slot = (LocalDataStoreSlot)datastorehash[name];
@@ -187,7 +186,7 @@ namespace System.Threading
}
public static void FreeNamedDataSlot(string name) {
- lock (datastore_lock) {
+ lock (typeof (Thread)) {
if (datastorehash == null)
InitDataStoreHash ();
LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name];
@@ -211,17 +210,15 @@ namespace System.Threading
public extern static int GetDomainID();
public static LocalDataStoreSlot GetNamedDataSlot(string name) {
- lock (datastore_lock) {
- if (datastorehash == null)
- InitDataStoreHash ();
- LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name];
+ if (datastorehash == null)
+ InitDataStoreHash ();
+ LocalDataStoreSlot slot=(LocalDataStoreSlot)datastorehash[name];
- if(slot==null) {
- slot=AllocateNamedDataSlot(name);
- }
-
- return(slot);
+ if(slot==null) {
+ slot=AllocateNamedDataSlot(name);
}
+
+ return(slot);
}
[MethodImplAttribute(MethodImplOptions.InternalCall)]
diff --git a/mcs/class/corlib/System.Threading/Timer.cs b/mcs/class/corlib/System.Threading/Timer.cs
index 1675a5a4be7..164c60ef2ca 100755
--- a/mcs/class/corlib/System.Threading/Timer.cs
+++ b/mcs/class/corlib/System.Threading/Timer.cs
@@ -195,11 +195,10 @@ namespace System.Threading
if (runner == null)
return false;
-
- start_event.Reset ();
- runner.Abort ();
+
runner.DueTime = dueTime;
runner.Period = period;
+ runner.Abort ();
start_event.Set ();
return true;
}