为什么线程不能执行

157796045 2004-04-25 08:33:48
是一个控制台程序

用createthread建立线程DWORD WINAPI thread(LPVOID){cout<<"aaa";}
开始可以执行,但将createthread第五个参数改为CREATE_SUSPEND编译后再将其改回
编译程序可运行但命令行上什么也没有

难道是永远将线程挂起了????
...全文
47 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
fengyu1907 2004-04-26
  • 打赏
  • 举报
回复
唉,来晚了,分数要被"weirdy(软件设计师)"挣走了.
xenke 2004-04-26
  • 打赏
  • 举报
回复
是永远挂起了,除非你用ResumeThread()
yangrudy 2004-04-26
  • 打赏
  • 举报
回复
第五个参数改为CREATE_SUSPEND后,线程便会挂起,直到你调用ResumeThread()函数

----摘自msdn
Specifies additional flags that control the creation of the thread. If the CREATE_SUSPENDED flag is specified, the thread is created in a suspended state, and will not run until the ResumeThread function is called. If this value is zero, the thread runs immediately after creation. At this time, no other values are supported
--------
primen 2004-04-25
  • 打赏
  • 举报
回复
哈哈,先CLEAN,再编译运行吧。
Caps77 2004-04-25
  • 打赏
  • 举报
回复
不要用ctrl+f5,直接f5运行

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧