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:
- namcheol
- Date:
- 2020-05-18
- Revision:
- 3:1c8ab6d6af18
- Parent:
- 2:20e20cfae75e
File content as of revision 3:1c8ab6d6af18:
#include "mbed.h" Serial pc(USBTX, USBRX, 115200); Thread thread1, thread2, thread3; Mutex mutex; void thread_1() { while(true) { mutex.lock(); for(int i = 0; i<50; i++) printf("1"); printf("\r\n"); mutex.unlock(); } } void thread_2() { while(true) { mutex.lock(); for(int i = 0; i<50; i++) printf("2"); printf("\r\n"); mutex.unlock(); } } void thread_3() { while(true) { mutex.lock(); for(int i = 0; i<50; i++) printf("3"); printf("\r\n"); mutex.unlock(); } } int main() { thread1.start(thread_1); thread2.start(thread_2); thread3.start(thread_3); while(true); }