Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6359767
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:33:46+00:00 2026-05-24T23:33:46+00:00

I have a startup function that calls a function which returns a boolean based

  • 0

I have a startup function that calls a function which returns a boolean based on whether the set up is successful or not. True if successful, false if failed. I would like to start that function on a new thread and then check the status of the function: here is the code.

System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(StartAdapter));
thread.Start();

My question is, how in that case would I check the return status of the startadapter method? Because my friend told me that I will not know the return status because it is started on another thread, and yet trying:

System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(StartAdapter));
thread.Start();
bool result = StartAdapter();

would call the function twice, which is something I don’t want either. Does anybody have some insight into this?

How in this case would I check the boolean returned from the startadapter function?

.NET 3.5

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T23:33:47+00:00Added an answer on May 24, 2026 at 11:33 pm

    for this case there is the Task<T> class that executes on the ThreadPool (for example) and lets you know the return value after it’s finished

    just use:

    
    
    var task = TaskFactory&ltyourResultType&gt.StartNew(StartAdapter);
    Action&ltyourResultType&gt actionAfterResult = ...; // whatever you have to do
    task.ContinueWith(actionAfterResult);
    
    // or:
    var result = task.Result; // this will block till the result is computed
    
    // or another one of the alternatives you can learn about on MSDN (see link above)
    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Introduction I have been so annoyed by applications that have a startup dialog which
I have a function called GetIP which I call on startup and when the
I have a C# project building winexe that startup without console window. However, I
I have multiple winforms applications that download large sets of reference data on startup.
My application will have a per machine (not per user) Startup shortcut. I can
I'm trying to hide window after its startup. I have own window-class which is
I have an ASP.NET MVC app which has a bootstrapper class that configures log4net
I have an application which has some classes that handle some specific functions, have
I have a problem regarding StartUp Url in WPF. I have a LoginView.xaml and
I have a C# class library and a startup project (a console app). The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.