Mercurial > flash_v2
comparison packages/kernel/current/include/mbox.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_MBOX_HXX | 1 #ifndef CYGONCE_KERNEL_MBOX_HXX |
| 2 #define CYGONCE_KERNEL_MBOX_HXX | 2 #define CYGONCE_KERNEL_MBOX_HXX |
| 3 | 3 |
| 4 //========================================================================== | 4 //========================================================================== |
| 5 // | 5 // |
| 6 // mbox.hxx | 6 // mbox.hxx |
| 7 // | 7 // |
| 8 // Plain (void *) Mbox (Message Box/Mailbox) class declarations | 8 // Plain (void *) Mbox (Message Box/Mailbox) 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): hmt | 35 // Author(s): hmt |
| 36 // Contributors: hmt | 36 // Contributors: hmt |
| 37 // Date: 1998-02-10 | 37 // Date: 1998-02-10 |
| 38 // Purpose: Define Mbox class interfaces | 38 // Purpose: Define Mbox class interfaces |
| 39 // Description: The classes defined here provide the APIs for mboxes. | 39 // Description: The classes defined here provide the APIs for mboxes. |
| 40 // Usage: #include <cyg/kernel/mbox.hxx> | 40 // Usage: #include <cyg/kernel/mbox.hxx> |
| 41 // | 41 // |
| 42 // | 42 // |
| 43 //####DESCRIPTIONEND#### | 43 //####DESCRIPTIONEND#### |
| 44 // | 44 // |
| 45 //========================================================================== | 45 //========================================================================== |
| 46 | 46 |
| 81 CYGDBG_DEFINE_CHECK_THIS | 81 CYGDBG_DEFINE_CHECK_THIS |
| 82 | 82 |
| 83 Cyg_Mbox(); // Constructor | 83 Cyg_Mbox(); // Constructor |
| 84 ~Cyg_Mbox(); // Destructor | 84 ~Cyg_Mbox(); // Destructor |
| 85 | 85 |
| 86 void * get(); // get an item; wait if none | 86 void * get(); // get an item; wait if none |
| 87 #ifdef CYGFUN_KERNEL_THREADS_TIMER | 87 #ifdef CYGFUN_KERNEL_THREADS_TIMER |
| 88 void * get( cyg_tick_count timeout ); | 88 void * get( cyg_tick_count timeout ); |
| 89 #endif | 89 #endif |
| 90 void * tryget(); // just one attempt | 90 void * tryget(); // just one attempt |
| 91 | 91 |
| 92 void * peek_item(); // Get next item to be returned | 92 void * peek_item(); // Get next item to be returned |
| 93 // without removing it | 93 // without removing it |
| 94 | 94 |
| 95 #ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT // then we support it too | 95 #ifdef CYGMFN_KERNEL_SYNCH_MBOXT_PUT_CAN_WAIT // then we support it too |
| 96 cyg_bool put( void *item ); // put an item; wait if full | 96 cyg_bool put( void *item ); // put an item; wait if full |
| 97 #ifdef CYGFUN_KERNEL_THREADS_TIMER | 97 #ifdef CYGFUN_KERNEL_THREADS_TIMER |
| 98 cyg_bool put( void *item, cyg_tick_count timeout ); | 98 cyg_bool put( void *item, cyg_tick_count timeout ); |
| 99 #endif | 99 #endif |
| 100 #endif | 100 #endif |
| 101 cyg_bool tryput( void *item ); // fails if Q full | 101 cyg_bool tryput( void *item ); // fails if Q full |
| 102 | 102 |
| 103 inline | 103 inline |
| 104 cyg_count32 peek() // Get current count value | 104 cyg_count32 peek() // Get current count value |
| 105 { | 105 { |
| 106 return m.peek(); | 106 return m.peek(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 inline | 109 inline |
| 110 cyg_bool waiting_to_get() // Any threads waiting to get? | 110 cyg_bool waiting_to_get() // Any threads waiting to get? |
| 111 { | 111 { |
| 112 return m.waiting_to_get(); | 112 return m.waiting_to_get(); |
| 113 } | 113 } |
| 114 inline | 114 inline |
| 115 cyg_bool waiting_to_put() // Any threads waiting to put? | 115 cyg_bool waiting_to_put() // Any threads waiting to put? |
| 116 { | 116 { |
| 117 return m.waiting_to_put(); | 117 return m.waiting_to_put(); |
| 118 } | 118 } |
| 119 }; | 119 }; |
| 120 | 120 |
