admin管理员组文章数量:1635824
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操作。
转载于:https://wwwblogs/fdyang/archive/2013/06/03/3115866.html
本文标签: ArgumentExceptionSystemdestinationlongArray
版权声明:本文标题:System.ArgumentException: Destination array was not long enough. 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1729217019a1190543.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论