|
From: Hans D. <dul...@us...> - 2001-04-04 19:47:53
|
Update of /cvsroot/corelinux/corelinux/src/classlibs/corelinux
In directory usw-pr-cvs1:/tmp/cvs-serv14353
Modified Files:
Thread.cpp
Log Message:
Obtained PID of terminating thread from waitpid, not from vptr.
This is a temporary fix until a better way of obtaining PID is found.
Also, call to destroyThreadContext had to be disabled, otherwise some
threads might get exception.
Index: Thread.cpp
===================================================================
RCS file: /cvsroot/corelinux/corelinux/src/classlibs/corelinux/Thread.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** Thread.cpp 2001/03/25 14:04:23 1.19
--- Thread.cpp 2001/04/04 19:47:47 1.20
***************
*** 472,479 ****
std::cout << " Terminate received " << std::endl;
*/
! ThreadIdentifier anId = DwordPtr(vPtr)[13];
! ThreadContext aContext(Thread::getThreadContext(anId));
! aContext.setThreadState (THREAD_NORMAL_EXIT);
! destroyThreadContext (anId);
}
--- 472,493 ----
std::cout << " Terminate received " << std::endl;
*/
!
! int pid = waitpid( -1, NULL, WNOHANG );
!
! if (pid != -1)
! {
!
! ThreadIdentifier anId = pid;
! ThreadContext aContext( Thread::getThreadContext( anId ) );
! aContext.setThreadState( THREAD_NORMAL_EXIT );
!
! // If the following line is enabled, exception will occur
!
! //destroyThreadContext( anId );
! }
! else
! {
! ; // do nothing
! }
}
|