Commit 157e18d7 authored by Jeremy Meng's avatar Jeremy Meng

Disable Browsable attribute which is from winforms for design time property window support.

Remove usage of ThreadPriority for netcore.
parent 6efda435
...@@ -139,7 +139,11 @@ public static string TryNormalize(string value) ...@@ -139,7 +139,11 @@ public static string TryNormalize(string value)
/// <summary> /// <summary>
/// Indicates whether the connection should be encrypted /// Indicates whether the connection should be encrypted
/// </summary> /// </summary>
[Obsolete("Please use .Ssl instead of .UseSsl"), Browsable(false), EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("Please use .Ssl instead of .UseSsl"),
#if !NETCORE
Browsable(false),
#endif
EditorBrowsable(EditorBrowsableState.Never)]
public bool UseSsl { get { return Ssl; } set { Ssl = value; } } public bool UseSsl { get { return Ssl; } set { Ssl = value; } }
/// <summary> /// <summary>
......
...@@ -31,7 +31,11 @@ public HashEntry(RedisValue name, RedisValue value) ...@@ -31,7 +31,11 @@ public HashEntry(RedisValue name, RedisValue value)
/// <summary> /// <summary>
/// The name of the hash field /// The name of the hash field
/// </summary> /// </summary>
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Name", false)] [
#if !NETCORE
Browsable(false),
#endif
EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Name", false)]
public RedisValue Key { get { return name; } } public RedisValue Key { get { return name; } }
/// <summary> /// <summary>
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
#if FEATURE_SERIALIZATION
using System.Runtime.Serialization; using System.Runtime.Serialization;
#endif
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
......
...@@ -128,13 +128,17 @@ public void Dispose() ...@@ -128,13 +128,17 @@ public void Dispose()
if (outStream != null) if (outStream != null)
{ {
multiplexer.Trace("Disconnecting...", physicalName); multiplexer.Trace("Disconnecting...", physicalName);
#if !NETCORE
try { outStream.Close(); } catch { } try { outStream.Close(); } catch { }
#endif
try { outStream.Dispose(); } catch { } try { outStream.Dispose(); } catch { }
outStream = null; outStream = null;
} }
if (netStream != null) if (netStream != null)
{ {
#if !NETCORE
try { netStream.Close(); } catch { } try { netStream.Close(); } catch { }
#endif
try { netStream.Dispose(); } catch { } try { netStream.Dispose(); } catch { }
netStream = null; netStream = null;
} }
......
...@@ -376,10 +376,14 @@ private void ReadImpl() ...@@ -376,10 +376,14 @@ private void ReadImpl()
private void StartReader() private void StartReader()
{ {
#if !NETCORE
var thread = new Thread(read, 32 * 1024); // don't need a huge stack var thread = new Thread(read, 32 * 1024); // don't need a huge stack
thread.Priority = ThreadPriority.AboveNormal; // time critical
#else
var thread = new Thread(read); // don't need a huge stack
#endif
thread.Name = name + ":Read"; thread.Name = name + ":Read";
thread.IsBackground = true; thread.IsBackground = true;
thread.Priority = ThreadPriority.AboveNormal; // time critical
thread.Start(this); thread.Start(this);
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
......
...@@ -126,8 +126,12 @@ public SocketManager(string name = null) ...@@ -126,8 +126,12 @@ public SocketManager(string name = null)
// we need a dedicated writer, because when under heavy ambient load // we need a dedicated writer, because when under heavy ambient load
// (a busy asp.net site, for example), workers are not reliable enough // (a busy asp.net site, for example), workers are not reliable enough
#if !NETCORE
Thread dedicatedWriter = new Thread(writeAllQueues, 32 * 1024); // don't need a huge stack; Thread dedicatedWriter = new Thread(writeAllQueues, 32 * 1024); // don't need a huge stack;
dedicatedWriter.Priority = ThreadPriority.AboveNormal; // time critical dedicatedWriter.Priority = ThreadPriority.AboveNormal; // time critical
#else
Thread dedicatedWriter = new Thread(writeAllQueues);
#endif
dedicatedWriter.Name = name + ":Write"; dedicatedWriter.Name = name + ":Write";
dedicatedWriter.IsBackground = true; // should not keep process alive dedicatedWriter.IsBackground = true; // should not keep process alive
dedicatedWriter.Start(this); // will self-exit when disposed dedicatedWriter.Start(this); // will self-exit when disposed
...@@ -334,7 +338,9 @@ private void Shutdown(Socket socket) ...@@ -334,7 +338,9 @@ private void Shutdown(Socket socket)
{ {
OnShutdown(socket); OnShutdown(socket);
try { socket.Shutdown(SocketShutdown.Both); } catch { } try { socket.Shutdown(SocketShutdown.Both); } catch { }
#if !NETCORE
try { socket.Close(); } catch { } try { socket.Close(); } catch { }
#endif
try { socket.Dispose(); } catch { } try { socket.Dispose(); } catch { }
} }
} }
......
...@@ -32,13 +32,21 @@ public SortedSetEntry(RedisValue element, double score) ...@@ -32,13 +32,21 @@ public SortedSetEntry(RedisValue element, double score)
/// <summary> /// <summary>
/// The score against the element /// The score against the element
/// </summary> /// </summary>
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Score", false)] [
#if !NETCORE
Browsable(false),
#endif
EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Score", false)]
public double Value { get { return score; } } public double Value { get { return score; } }
/// <summary> /// <summary>
/// The unique element stored in the sorted set /// The unique element stored in the sorted set
/// </summary> /// </summary>
[Browsable(false), EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Element", false)] [
#if !NETCORE
Browsable(false),
#endif
EditorBrowsable(EditorBrowsableState.Never), Obsolete("Please use Element", false)]
public RedisValue Key { get { return element; } } public RedisValue Key { get { return element; } }
/// <summary> /// <summary>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment