Mercurial > flash_v2
comparison packages/kernel/current/include/thread.hxx @ 2:443894e2e912 ecos-v1_2_1-release
Block commit of eCos version 1.2.1
| author | jlarmour |
|---|---|
| date | Tue, 11 May 1999 12:24:34 +0000 |
| parents | 3111d98ba7b3 |
| children | c38311975d4f |
comparison
equal
deleted
inserted
replaced
| 1:72f549f0d891 | 2:443894e2e912 |
|---|---|
| 1 #ifndef CYGONCE_KERNEL_THREAD_HXX | 1 #ifndef CYGONCE_KERNEL_THREAD_HXX |
| 2 #define CYGONCE_KERNEL_THREAD_HXX | 2 #define CYGONCE_KERNEL_THREAD_HXX |
| 3 | 3 |
| 4 //========================================================================== | 4 //========================================================================== |
| 5 // | 5 // |
| 6 // thread.hxx | 6 // thread.hxx |
| 7 // | 7 // |
| 8 // Thread class declarations | 8 // Thread class declarations |
| 9 // | 9 // |
| 10 //========================================================================== | 10 //========================================================================== |
| 11 //####COPYRIGHTBEGIN#### | 11 //####COPYRIGHTBEGIN#### |
| 12 // | 12 // |
| 13 // ------------------------------------------- | 13 // ------------------------------------------- |
| 23 // | 23 // |
| 24 // The Original Code is eCos - Embedded Cygnus Operating System, released | 24 // The Original Code is eCos - Embedded Cygnus Operating System, released |
| 25 // September 30, 1998. | 25 // September 30, 1998. |
| 26 // | 26 // |
| 27 // The Initial Developer of the Original Code is Cygnus. Portions created | 27 // The Initial Developer of the Original Code is Cygnus. Portions created |
| 28 // by Cygnus are Copyright (C) 1998 Cygnus Solutions. All Rights Reserved. | 28 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. |
| 29 // ------------------------------------------- | 29 // ------------------------------------------- |
| 30 // | 30 // |
| 31 //####COPYRIGHTEND#### | 31 //####COPYRIGHTEND#### |
| 32 //========================================================================== | 32 //========================================================================== |
| 33 //#####DESCRIPTIONBEGIN#### | 33 //#####DESCRIPTIONBEGIN#### |
| 34 // | 34 // |
| 35 // Author(s): nickg | 35 // Author(s): nickg |
| 36 // Contributors: nickg | 36 // Contributors: nickg |
| 37 // Date: 1997-09-09 | 37 // Date: 1997-09-09 |
| 38 // Purpose: Define Thread class interfaces | 38 // Purpose: Define Thread class interfaces |
| 39 // Description: The classes defined here collectively implement the | 39 // Description: The classes defined here collectively implement the |
| 40 // internal API used to create, configure and manage threads. | 40 // internal API used to create, configure and manage threads. |
| 41 // Usage: #include <cyg/kernel/thread.hxx> | 41 // Usage: #include <cyg/kernel/thread.hxx> |
| 42 // | 42 // |
| 43 //####DESCRIPTIONEND#### | 43 //####DESCRIPTIONEND#### |
| 44 // | 44 // |
| 45 //========================================================================== | 45 //========================================================================== |
| 46 | 46 |
| 201 public: | 201 public: |
| 202 enum { // Thread state values | 202 enum { // Thread state values |
| 203 | 203 |
| 204 RUNNING = 0, // Thread is runnable or running | 204 RUNNING = 0, // Thread is runnable or running |
| 205 SLEEPING = 1, // Thread is waiting for something to happen | 205 SLEEPING = 1, // Thread is waiting for something to happen |
| 206 COUNTSLEEP = 2, // Sleep in counted manner | 206 COUNTSLEEP = 2, // Sleep in counted manner |
| 207 SUSPENDED = 4, // Suspend count is non-zero | 207 SUSPENDED = 4, // Suspend count is non-zero |
| 208 CREATING = 8, // Thread is being created | 208 CREATING = 8, // Thread is being created |
| 209 EXITED = 16, // Thread has exited | 209 EXITED = 16, // Thread has exited |
| 210 | 210 |
| 211 // This is the set of bits that must be cleared by a generic | 211 // This is the set of bits that must be cleared by a generic |
| 311 | 311 |
| 312 static void exit(); // Terminate thread | 312 static void exit(); // Terminate thread |
| 313 | 313 |
| 314 static void yield(); // Yield CPU to another thread | 314 static void yield(); // Yield CPU to another thread |
| 315 | 315 |
| 316 #ifdef CYGSEM_KERNEL_SCHED_MLQUEUE | 316 static void rotate_queue( cyg_priority pri ); |
| 317 static void rotate_queue( cyg_priority pri ); | |
| 318 // Rotate that run queue | 317 // Rotate that run queue |
| 319 #endif | 318 |
| 319 void to_queue_head( void ); | |
| 320 // Move to the head of its queue | |
| 321 // (not necessarily a scheduler q) | |
| 320 | 322 |
| 321 static Cyg_Thread *self(); // Return current thread | 323 static Cyg_Thread *self(); // Return current thread |
| 322 | 324 |
| 323 | 325 |
| 324 // The following are called on threads other than the current one. | 326 // The following are called on threads other than the current one. |
| 488 // ------------------------------------------------------------------------- | 490 // ------------------------------------------------------------------------- |
| 489 // Thread Queue class. | 491 // Thread Queue class. |
| 490 // This defines the main API for manipulating queues of threads. | 492 // This defines the main API for manipulating queues of threads. |
| 491 | 493 |
| 492 class Cyg_ThreadQueue | 494 class Cyg_ThreadQueue |
| 493 : private Cyg_ThreadQueue_Implementation | 495 : public Cyg_ThreadQueue_Implementation |
| 494 { | 496 { |
| 495 | 497 |
| 496 public: | 498 public: |
| 497 | 499 |
| 498 CYGDBG_DEFINE_CHECK_THIS | 500 CYGDBG_DEFINE_CHECK_THIS |
