-
September 15th, 2009, 08:00 AM
#1
Thread programming
I have a function A which is running under main thread.Function A calling function B.In function B we are creating a thread,i want to still in function till the thread execute. because B need to retun a result value to A.How do i do it,sleep() and join() both i can't use because i need all to be executed.
-
September 15th, 2009, 10:08 AM
#2
Re: Thread programming
If you want to block a function until a thread is complete then don't use the thread to begin with.
If you really need the thread because you don't want to hold up the rest of the process and you still need the return value when the thread is complete then you need to use a custom event.
Honestly though it sounds like you either need to redesign your code so it doesn't need to return a value, or you need to get rid of the thread.
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
|