Basic example showing the Semaphore API
mbed 2 and mbed OS 5
This is an mbed 2 example. mbed OS 5 has integrated the mbed library with mbed-rtos. For an mbed-os example, please see:
Import programrtos_semaphore
semaphore example
Revision 4:ec4791bc6554, committed 2017-01-11
- Comitter:
- Bartek Szatkowski
- Date:
- Wed Jan 11 14:39:06 2017 +0000
- Parent:
- 3:02e47d35a686
- Child:
- 5:574f47121e8e
- Commit message:
- Update example to use current RTOS API
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jun 04 16:05:26 2013 +0100 +++ b/main.cpp Wed Jan 11 14:39:06 2017 +0000 @@ -13,8 +13,11 @@ } int main (void) { - Thread t2(test_thread, (void *)"Th 2"); - Thread t3(test_thread, (void *)"Th 3"); - + Thread t2; + Thread t3; + + t2.start(callback(test_thread, (void *)"Th 2")); + t3.start(callback(test_thread, (void *)"Th 3")); + test_thread((void *)"Th 1"); }