|
-
December 14th, 2008, 05:06 PM
#1
thread return
where does the number returned by the thread function goes???
-
December 14th, 2008, 05:20 PM
#2
Re: thread return
This is platform dependent.
In windows you can use the GetExitCodeThread Function to retreave the return value.
Hope this helps.
-
December 14th, 2008, 05:39 PM
#3
Re: thread return
I'll have to try it but it seems like the right function.
for future reference I want to know the return value cause what I'm doing is returning an address to a variable I need to use in the main;
Code:
unsigned __stdcall foos(void *param)
{
char *fName=(char*)param;
ifstream in(fName);
int *ret=getStatistics(in);
return reinterpret_cast<unsigned>(ret);
}
now in main:
uintptr_t th1=_beginthreadex(NULL,0,foo1,NULL,0,NULL);
int *stat=reinterpret_cast<int*>(getreturn(th1));//getreturn fictional function just to illustrate my intentions
thanks "couling"
Last edited by compuKidd; December 14th, 2008 at 05:40 PM.
Reason: forgot detail
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|