ACE_Thread_Manager::instance()->suspend怎么不起作用啊
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 线程挂不起 你用GetLastError看一下错误代码。要不就追踪进去。 我是linux下,我用errno查看错误,是95,应该是EOPNOTSUPP---Operation not supported on transport endpoint,源代码上说挂起不支持pthread,是不是这个原因哦?74./**
75. * @name Suspend and resume methods
76. *
77. * Suspend/resume is not supported on all platforms. For example, Pthreads
78. * does not support these functions.
79. */
80.//@{
81.
82./// Suspend all threads
83.int suspend_all (void);
84.
85./// Suspend a single thread.
86.int suspend (ACE_thread_t);
87.
88./// Suspend a group of threads.
89.int suspend_grp (int grp_id);
页:
[1]