zoukankan      html  css  js  c++  java
  • System.ArgumentException: Destination array was not long enough.

    Caught: System.ArgumentException: Destination array was not long enough. Check destIndex and length  and the array's lower bounds.     at System.Array.Copy(Array sourceArray  Int32 sourceIndex  Array destinationArray  Int32 destinationIndex  Int32 length  Boolean reliable)     at System.Collections.Generic.Queue`1.ToArray() 

    错误:有个ConstantSizedQueue,在转化为Array 试图返回时报错。

    原因:多线程中,此Queue在试图转化为Array时,在其他线程中被Enqueue操作了。

    对策:lock此Queue对象,然后再进行ToArray操作。

  • 相关阅读:
    STM32之滴答定时器
    串口--USART1
    风扇--PWM控制
    触摸屏移植Emwin
    emwin--GUI
    extern
    STM32之定时器时间计算
    stm32之定时器
    stm32之PWM
    stm32之SPI
  • 原文地址:https://www.cnblogs.com/fdyang/p/3115866.html
Copyright © 2011-2022 走看看