Add 'sleeping' flag to struct Thread

Will be used by future patches. Also:

- Renamed Idle in AllThreadsShouldSleep

- Explicitly inited AllThreadsShouldExit and AllThreadsShouldSleep
  in init_thread() instead of use an anonymous global initialization.

- Rewritten idle_loop() while condition to avoid a 'break' statement

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2010-02-13 11:22:57 +01:00
parent cb08413dc4
commit 6382324afd
2 changed files with 18 additions and 10 deletions

View File

@@ -71,6 +71,7 @@ struct Thread {
volatile bool stop;
volatile bool running;
volatile bool idle;
volatile bool sleeping;
volatile bool workIsWaiting;
volatile bool printCurrentLine;
unsigned char pad[64]; // set some distance among local data for each thread