简体   繁体   English

ThreadPool.QueueUserWorkItem 委托永远不会被调用

[英]ThreadPool.QueueUserWorkItem delegate never gets called

I am using MonoTouch 4.03.我正在使用 MonoTouch 4.03。 I have some code like this:我有一些这样的代码:

ThreadPool.QueueUserWorkItem (delegate
{
     Debug.WriteLine("Making connect request");
     client.Connect();
});

About one in 10 times it doesn't get fired.大约十分之一的人不会被解雇。 I'm only making very light use of ThreadPool.我只是非常轻地使用 ThreadPool。

NOTE (added 19th July): Currently I have turned LLVM optimisation off and that appears to have cured it.注意(7 月 19 日添加):目前我已经关闭了 LLVM 优化,这似乎已经治愈了它。

This is fixed in MonoTouch 4.06 (or possibly the version before - in any case, it's fixed).这在 MonoTouch 4.06 中已修复(或者可能是之前的版本 - 无论如何,它已修复)。 I suspect the LLVM optimiser.我怀疑 LLVM 优化器。 The MonoTouch release notes show a number of bug fixes in that area. MonoTouch 发行说明显示了该区域中的许多错误修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM