Mhd
Mhd

Reputation: 81

Thread states in c#

when i create a thread to do some functions the state of it will first be "running" but after that it will change into "waitsleepjoin"or"stopped" state so :

  1. How a thread can reach a waitsleepjoin state?
  2. How can a thread can reach the stopped state?

Upvotes: 1

Views: 628

Answers (1)

SLaks
SLaks

Reputation: 887877

  1. By calling Sleep() or Join(), or when waiting for a lock.

  2. After it finishes all of its code (after the original method returns)

Upvotes: 2

Related Questions