Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 #include "rtos.h" 00003 00004 Semaphore two_slots(2); 00005 00006 void test_thread(void const *name) { 00007 while (true) { 00008 two_slots.wait(); 00009 printf("%s\n\r", (const char*)name); 00010 Thread::wait(1000); 00011 two_slots.release(); 00012 } 00013 } 00014 00015 int main (void) { 00016 Thread t2; 00017 Thread t3; 00018 00019 t2.start(callback(test_thread, (void *)"Th 2")); 00020 t3.start(callback(test_thread, (void *)"Th 3")); 00021 00022 test_thread((void *)"Th 1"); 00023 }
Generated on Tue Jul 12 2022 11:27:36 by
