Skip to content

Commit cb70c8a

Browse files
Christoph BauerChristoph Bauer
authored andcommitted
Net482 supports arm. Better Null Handling
1 parent 069c2da commit cb70c8a

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/NetMQ/Core/Utils/OpCode.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ public static bool Open()
2020
string? val = Environment.GetEnvironmentVariable("NETQM_SUPPRESS_RDTSC");
2121
if (!string.IsNullOrEmpty(val))
2222
return false;
23-
#if NETSTANDARD || NET
23+
2424
if (RuntimeInformation.ProcessArchitecture != Architecture.X86 &&
2525
RuntimeInformation.ProcessArchitecture != Architecture.X64)
2626
{
2727
return false; // RDTSC instruction not supported
2828
}
29-
#endif
3029

3130
var p = (int)Environment.OSVersion.Platform;
3231

src/NetMQ/NetMQPoller.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public NetMQPoller()
155155

156156
// Try to dequeue and execute all pending tasks
157157
while (m_tasksQueue.TryDequeue(out Task? task, TimeSpan.Zero))
158-
TryExecuteTask(task!);
158+
TryExecuteTask(task);
159159
};
160160

161161
m_sockets.Add(((ISocketPollable)m_tasksQueue).Socket);
@@ -639,11 +639,9 @@ private void RunPoller()
639639
}
640640
}
641641

642-
#if !NET35
643642
// Try to dequeue and execute all pending tasks before stopping poller
644643
while (m_tasksQueue.TryDequeue(out Task? task, TimeSpan.Zero))
645-
TryExecuteTask(task!);
646-
#endif
644+
TryExecuteTask(task);
647645
}
648646
finally
649647
{

src/NetMQ/NetMQQueue.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public event EventHandler<NetMQQueueEventArgs<T>> ReceiveReady
9494
/// <param name="result">Will be filled with the item upon success</param>
9595
/// <param name="timeout">Timeout to try and dequeue and item</param>
9696
/// <returns>Will return false if it didn't succeed to dequeue an item after the timeout.</returns>
97-
public bool TryDequeue(out T? result, TimeSpan timeout)
97+
public bool TryDequeue([MaybeNullWhen(false)] out T result, TimeSpan timeout)
9898
{
9999
if (m_reader.TryReceive(ref m_dequeueMsg, timeout))
100100
{

0 commit comments

Comments
 (0)