dbTalk Databases Forums  

Thread bug of BDB example of Win32

comp.databases.berkeley-db comp.databases.berkeley-db


Discuss Thread bug of BDB example of Win32 in the comp.databases.berkeley-db forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
sky
 
Posts: n/a

Default Thread bug of BDB example of Win32 - 02-05-2006 , 09:51 PM






Hi,
I find one bug of BDB example of Win32.

Entironment:
OS:Win2000
BDB:4.4.16
Compiler:VC6+sp6

The example locate \\BDB_dir\\examples_cxx\txn_guide.The program define
one Marco
#define thread_join(thr, statusp)
\
((WaitForSingleObject((thr), INFINITE) == WAIT_OBJECT_0) &&
\
GetExitCodeThread((thr), (LPDWORD)(statusp)) ? 0 : -1)
to check if the thread exit normallly.

In main() function use the Marco as below
(void)thread_join(writerThreads[i], NULL);
The second parameter can't be NULL,with NULL the GetExitCodeThread()
will throw one exception for invalid address access.

After I use the Marco like this
DWORD exidcode=0;
(void)thread_join(writerThreads[i], &exidcode);
The threads work well.

Thanks
Sky


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.