以下代码在使用.net 4.0编译时抛出以下异常,同时符合.net 2.0,没关系,任何人遇到我?,请帮助(我没有在回调函数中使用DateTime)。< / p>
public void ProcessPriceUpdate()
{
Interlocked.Increment(ref this.counts);
lock (contractLock)
{
ThreadPool.QueueUserWorkItem(priceCallback, null);
}
}
>System.ArgumentOutOfRangeException was unhandled
>Message=Value to add was out of range.
>Parameter name: value
>Source=mscorlib
>ParamName=value
>StackTrace:
>at System.DateTime.Add(Double value, Int32 scale)
>at System.Threading.PlatformHelper.get_ProcessorCount()
>at System.Threading.SpinWait.SpinOnce()
>at System.Threading.ThreadPoolWorkQueue.QueueSegment.TryDequeue(IThreadPoolWorkItem& node)
>at System.Threading.ThreadPoolWorkQueue.Dequeue(ThreadPoolWorkQueueThreadLocals tl, IThreadPoolWorkItem& callback, Boolean& missedSteal)
>at System.Threading.ThreadPoolWorkQueue.Dispatch()
>at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
>InnerException: