summaryrefslogtreecommitdiff
path: root/csharp/src/Ice/Timer.cs
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2016-05-11 16:51:13 +0200
committerJose <jose@zeroc.com>2016-05-11 16:51:13 +0200
commit20ead35bcd15c258b00da6b1a16d26107f8dea8b (patch)
tree0aa99a82b9d56383c76c372fc1050dfd5493b4e9 /csharp/src/Ice/Timer.cs
parentFixed make install issue (diff)
downloadice-20ead35bcd15c258b00da6b1a16d26107f8dea8b.tar.bz2
ice-20ead35bcd15c258b00da6b1a16d26107f8dea8b.tar.xz
ice-20ead35bcd15c258b00da6b1a16d26107f8dea8b.zip
CSharp mapping cleanup
- Remove code support for old ussuported frameworks (SILVERLIGHT, COMPACT, MONO) - Remove code support for deprecated collection mappings clr:collection
Diffstat (limited to 'csharp/src/Ice/Timer.cs')
-rw-r--r--csharp/src/Ice/Timer.cs51
1 files changed, 0 insertions, 51 deletions
diff --git a/csharp/src/Ice/Timer.cs b/csharp/src/Ice/Timer.cs
index 497b60975c4..266faf90a19 100644
--- a/csharp/src/Ice/Timer.cs
+++ b/csharp/src/Ice/Timer.cs
@@ -15,10 +15,8 @@
namespace IceInternal
{
- using System;
using System.Diagnostics;
using System.Threading;
- using System.Collections;
using System.Collections.Generic;
public interface TimerTask
@@ -61,16 +59,7 @@ namespace IceInternal
try
{
_tasks.Add(task, token);
-#if SILVERLIGHT
- int index = _tokens.BinarySearch(token);
- Debug.Assert(index < 0);
- if(index < 0)
- {
- _tokens.Insert(~index, token);
- }
-#else
_tokens.Add(token, null);
-#endif
}
catch(System.ArgumentException)
{
@@ -98,16 +87,7 @@ namespace IceInternal
try
{
_tasks.Add(task, token);
-#if SILVERLIGHT
- int index = _tokens.BinarySearch(token);
- Debug.Assert(index < 0);
- if(index < 0)
- {
- _tokens.Insert(~index, token);
- }
-#else
_tokens.Add(token, null);
-#endif
}
catch(System.ArgumentException)
{
@@ -144,27 +124,17 @@ namespace IceInternal
//
// Only for use by Instance.
//
-#if !SILVERLIGHT
internal Timer(IceInternal.Instance instance, ThreadPriority priority)
{
init(instance, priority, true);
}
-#endif
internal Timer(IceInternal.Instance instance)
{
-#if !SILVERLIGHT
init(instance, ThreadPriority.Normal, false);
-#else
- init(instance);
-#endif
}
-#if !SILVERLIGHT
internal void init(IceInternal.Instance instance, ThreadPriority priority, bool hasPriority)
-#else
- internal void init(IceInternal.Instance instance)
-#endif
{
_instance = instance;
@@ -177,12 +147,10 @@ namespace IceInternal
_thread = new Thread(new ThreadStart(Run));
_thread.IsBackground = true;
_thread.Name = threadName + "Ice.Timer";
-#if !SILVERLIGHT
if(hasPriority)
{
_thread.Priority = priority;
}
-#endif
_thread.Start();
}
@@ -220,16 +188,7 @@ namespace IceInternal
if(_tasks.ContainsKey(token.task))
{
token.scheduledTime = Time.currentMonotonicTimeMillis() + token.delay;
-#if SILVERLIGHT
- int index = _tokens.BinarySearch(token);
- Debug.Assert(index < 0);
- if(index < 0)
- {
- _tokens.Insert(~index, token);
- }
-#else
_tokens.Add(token, null);
-#endif
}
}
}
@@ -256,11 +215,7 @@ namespace IceInternal
long now = Time.currentMonotonicTimeMillis();
Token first = null;
-#if SILVERLIGHT
- foreach(Token t in _tokens)
-#else
foreach(Token t in _tokens.Keys)
-#endif
{
first = t;
break;
@@ -389,13 +344,7 @@ namespace IceInternal
public TimerTask task;
}
-#if COMPACT
- private IDictionary<Token, object> _tokens = new SortedList<Token, object>();
-#elif SILVERLIGHT
- private List<Token> _tokens = new List<Token>();
-#else
private IDictionary<Token, object> _tokens = new SortedDictionary<Token, object>();
-#endif
private IDictionary<TimerTask, Token> _tasks = new Dictionary<TimerTask, Token>();
private Instance _instance;
private long _wakeUpTime = System.Int64.MaxValue;