gpt4 book ai didi

c# - Windows 8 商店应用程序不支持 System.Threading.Thread

转载 作者:太空狗 更新时间:2023-10-30 00:20:04 24 4
gpt4 key购买 nike

Windows 8 应用商店应用不再支持 Thread:

我在类库中创建了一个线程:

protected static Thread m_thread = null;

然后在其中一个函数中:

m_thread = new Thread(new ParameterizedThreadStart(RunDetection));
m_thread.Start(Something);

我还需要中止函数:

m_thread.Abort();

如何在 WIN8 商店应用程序中执行此操作?

最佳答案

您可以在线程池上运行您的线程过程。

中止线程从来都不是一个可行的选择,因为它可能会挂起您的整个进程(废弃的锁、不一致的全局状态)。

关于c# - Windows 8 商店应用程序不支持 System.Threading.Thread,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14514129/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com