mbed_example
/
rtos_semaphore
semaphore example
Diff: main.cpp
- Revision:
- 7:755dee0042c3
- Parent:
- 5:574f47121e8e
--- a/main.cpp Fri Jun 23 14:46:38 2017 -0500 +++ b/main.cpp Fri Feb 02 15:14:15 2018 -0600 @@ -1,15 +1,15 @@ #include "mbed.h" -Semaphore two_slots(2); +Semaphore one_slot(1); Thread t2; Thread t3; - + void test_thread(void const *name) { while (true) { - two_slots.wait(); + one_slot.wait(); printf("%s\n\r", (const char*)name); wait(1); - two_slots.release(); + one_slot.release(); } }