Hi @winanjaya
I believe that you can use .IsAlive
https://www.geeksforgeeks.org/how-to-check-whether-a-thread-is-alive-or-not-in-c/
Documentation can be found at:
------------------------------------
If this is helpful please accept answer.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi All,
I have 2 threads below, How to check if they finished the job?
new Thread(new ParameterizedThreadStart(Models.Cron.Job1)).Start(new object[] { tokensPid, token, scheduleType, tokenInfo, cronsPid1 });
new Thread(new ParameterizedThreadStart(Models.Cron.Job2)).Start(new object[] { tokensPid, token, cronsPid2, tokenInfo });
Hi @winanjaya
I believe that you can use .IsAlive
https://www.geeksforgeeks.org/how-to-check-whether-a-thread-is-alive-or-not-in-c/
Documentation can be found at:
------------------------------------
If this is helpful please accept answer.
Hi @winanjaya ,
You can check the Thread.ThreadState Property, then, it will return one of the ThreadState values indicating the state of the current thread.
Refer to the following sample code:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion