diff options
author | Gert Driesen <drieseng@users.sourceforge.net> | 2007-09-05 17:13:38 +0400 |
---|---|---|
committer | Gert Driesen <drieseng@users.sourceforge.net> | 2007-09-05 17:13:38 +0400 |
commit | ae5a5dd2e6c7694f89b1222e570dba6ec9cb5ea4 (patch) | |
tree | 97a989f213566d91f9e490dc1ac6d1ad02e84b9c /mcs/class/System/System.Timers | |
parent | 811c1b3bddf8d252e8cbcb105da9f7aeebabe671 (diff) |
* Timer.cs: On 2.0 profile, only allow 32-bit interval in ctor.
svn path=/trunk/mcs/; revision=85357
Diffstat (limited to 'mcs/class/System/System.Timers')
-rw-r--r-- | mcs/class/System/System.Timers/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/System/System.Timers/Timer.cs | 13 |
2 files changed, 11 insertions, 6 deletions
diff --git a/mcs/class/System/System.Timers/ChangeLog b/mcs/class/System/System.Timers/ChangeLog index 6662185c4b0..28882885727 100644 --- a/mcs/class/System/System.Timers/ChangeLog +++ b/mcs/class/System/System.Timers/ChangeLog @@ -1,3 +1,7 @@ +2007-09-05 Gert Driesen <drieseng@users.sourceforge.net> + + * Timer.cs: On 2.0 profile, only allow 32-bit interval in ctor. + 2006-12-19 Robert Jordan <robertj@gmx.net> * Timer.cs: Apply the latest patch at attached to bug #77847. diff --git a/mcs/class/System/System.Timers/Timer.cs b/mcs/class/System/System.Timers/Timer.cs index b0b8dacde15..b283441bd7f 100644 --- a/mcs/class/System/System.Timers/Timer.cs +++ b/mcs/class/System/System.Timers/Timer.cs @@ -46,7 +46,7 @@ namespace System.Timers ISynchronizeInvoke so; ManualResetEvent wait; Thread thread; - object locker = new object (); + readonly object locker = new object (); [Category("Behavior")] [TimersDescription("Occurs when the Interval has elapsed.")] @@ -58,14 +58,16 @@ namespace System.Timers public Timer (double interval) { +#if NET_2_0 + // MSBUG: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=296761 + if (interval > 0x7FFFFFFF) + throw new ArgumentException ("Invalid value: " + interval, "interval"); +#endif + autoReset = true; - enabled = false; Interval = interval; - so = null; - wait = null; } - [Category("Behavior")] [DefaultValue(true)] [TimersDescription("Indicates whether the timer will be restarted when it is enabled.")] @@ -212,4 +214,3 @@ namespace System.Timers } } } - |