找回密码
 用户注册

QQ登录

只需一步,快速开始

查看: 4137|回复: 2

ACE_Thread_Manager::instance()->suspend怎么不起作用啊

[复制链接]
发表于 2012-3-23 16:21:34 | 显示全部楼层 |阅读模式
  1. ACE_Thread_Manager::instance()->spawn((ACE_THR_FUNC)NetEngine_ePoll_Thread_send,this,THR_NEW_LWP | THR_DETACHED | THR_SCHED_DEFAULT | THR_SUSPENDED,&hRecvThread)
复制代码
首先我THR_SUSPENDED参数,线程启动就应该挂起,但是不知道为什么,没有挂起,
然后我调用ACE_Thread_Manager::instance()->suspend(hRecvThread)) 但是为什么总返回-1 线程挂不起
发表于 2012-3-24 00:00:13 | 显示全部楼层
你用GetLastError看一下错误代码。要不就追踪进去。
 楼主| 发表于 2012-3-26 10:08:47 | 显示全部楼层
我是linux下,我用errno查看错误,是95,应该是EOPNOTSUPP---Operation not supported on transport endpoint,源代码上说挂起不支持pthread,是不是这个原因哦?
  1. 74.  /**
  2. 75.   * @name Suspend and resume methods
  3. 76.   *
  4. 77.   * Suspend/resume is not supported on all platforms. For example, Pthreads
  5. 78.   * does not support these functions.
  6. 79.   */  
  7. 80.  //@{   
  8. 81.  
  9. 82.  /// Suspend all threads   
  10. 83.  int suspend_all (void);  
  11. 84.  
  12. 85.  /// Suspend a single thread.   
  13. 86.  int suspend (ACE_thread_t);  
  14. 87.  
  15. 88.  /// Suspend a group of threads.   
  16. 89.  int suspend_grp (int grp_id);  
复制代码
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-5-2 16:29 , Processed in 0.017521 second(s), 7 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表