RE: [Openthreads-info] Closing handles in WIN32 thread implementation
Brought to you by:
sspicer
From: Frank L. <fli...@fu...> - 2004-05-12 07:28:48
|
Hi Boris, Boris Bralo wrote: > Win32ConditionPrivateData closes handles at destruction ( it's in = Win32Condition.cpp). > As for thread handle, you're right, I'll fix this ASAP. Thanks. I noted the fix when updating from CVS. Further to this: - it may be safer to add to Thread::Thread(): pd->tid =3D 0; or: pd->tid =3D INVALID_HANDLE_VALUE; and use a macro CLOSEHANDLE() that looks like this: #define CLOSEHANDLE(h) if (h !=3D 0 && h !=3D INVALID_HANDLE_VALUE) = { CloseHandle(h); } I noted that in case a thread is created but not run, calling = CloseHandle() on an uninitialized pd->tid will give an error. - in Win32ThreadPrivateData::~Win32ThreadPrivateData() please also = close the cancelEvent. =20 =20 =20 > Anyway I'm not sure that's the reason for crash. I think it isn't. I found a something in the OSG mailing list that hints = at OSG not dealing correctly with exceptions thrown by OpenTreads from = cooperativeWait(). Regards, Frank Frank Lindeman Product Development Fugro-Jason Netherlands BV Phone +31 (0)10 280 1540 =20 PO Box 1573 Fax +31 (0)10 280 1511 3000 BN Rotterdam Email fli...@fu... =20 The Netherlands #1 in Reservoir Characterization Visit us at: http://www.fugro-jason.com/ This e-mail and any files transmitted with it are confidential and = intended solely for the use of the addressee. This e-mail shall not be = deemed binding unless confirmed in writing. If you have received it by = mistake, please let us know by e-mail reply and delete it from your = system; you may not copy this message or disclose its contents to = anyone. Please note that any views or opinions presented in this e-mail = are solely those of the author and do not necessarily represent those of = the company. E-mail transmission cannot be guaranteed to be secure or = error-free. The sender therefore does not accept liability for any = errors or omissions in the contents of this message, which arise as a = result of e-mail transmission. |