Jaydeep Shah
/
21_MUTEX_LOCK_UNLOCK
MUTEX and its use in MBED MUTEX LOCK and Unlock mechanism
Diff: main.cpp
- Revision:
- 2:0cf7e435eeb8
- Parent:
- 1:605f5624661e
diff -r 605f5624661e -r 0cf7e435eeb8 main.cpp --- a/main.cpp Sun Jul 26 10:59:21 2020 +0000 +++ b/main.cpp Sun Jul 26 11:00:53 2020 +0000 @@ -31,8 +31,7 @@ printf("This Thread lock the code %s: %d\n\r", name, state); wait(0.5); //sleep - printf("Thread cross & unlock %s: %d\n\r", name, state); //OUTSIDE CODE BLOCK --------- - + printf("Thread cross & unlock %s: %d\n\r", name, state); //OUTSIDE CODE BLOCK --------- M_LOCK.unlock(); //After completing task unlock the code ------------- UNLOCK THE BLOCK //DO NOT WRITE any print statement after unlock() it create missunderstanding ....