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
- Committer:
- mab5449
- Date:
- 2017-01-13
- Revision:
- 5:574f47121e8e
- Parent:
- 4:ec4791bc6554
- Child:
- 6:1a383b363dc3
File content as of revision 5:574f47121e8e:
#include "mbed.h"
Semaphore two_slots(2);
Thread t2;
Thread t3;
void test_thread(void const *name) {
while (true) {
two_slots.wait();
printf("%s\n\r", (const char*)name);
wait(1);
two_slots.release();
}
}
int main (void) {
t2.start(callback(test_thread, (void *)"Th 2"));
t3.start(callback(test_thread, (void *)"Th 3"));
test_thread((void *)"Th 1");
}
