Results 1 to 3 of 3
  1. #1
    nando88 is offline Member
    Join Date
    Aug 2013
    Posts
    28
    Rep Power
    0

    Default Return value from thread

    Can someone please tell me how to return a value from a thread?
    I'm asking this, because the only thread I've used is void and I need it to return something every time it executes.
    Thanks in advance!

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,244
    Rep Power
    19

    Default Re: Return value from thread

    Quote Originally Posted by nando88 View Post
    Can someone please tell me how to return a value from a thread?
    I'm asking this, because the only thread I've used is void and I need it to return something every time it executes.
    Thanks in advance!
    That doesn't make any sense. Thread is a class; classes don't 'return' anything, methods do.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    4,030
    Rep Power
    6

    Default Re: Return value from thread

    Nope. But since its a class, you can set a class property which you can get after the thread finishes executing.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Replies: 2
    Last Post: 12-11-2012, 11:35 AM
  2. Block thread until callback method has been called by other thread
    By James2000 in forum Threads and Synchronization
    Replies: 4
    Last Post: 05-11-2012, 09:46 PM
  3. Main Thread not waiting for grand child thread to finish
    By prashanthn in forum Threads and Synchronization
    Replies: 3
    Last Post: 06-07-2011, 09:26 AM
  4. Replies: 4
    Last Post: 05-08-2011, 09:00 PM
  5. Trigger main thread method from secondary thread?
    By DigitalMan in forum Threads and Synchronization
    Replies: 8
    Last Post: 01-26-2010, 02:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •