Demonstration of deadlocks by adding a small delay updated for mbed os 5.4

Fork of Task617-mbedos54 by Stage-1 Students SoCEM

Files at this revision

API Documentation at this revision

Comitter:
noutram
Date:
Mon Apr 03 11:34:50 2017 +0000
Parent:
5:d6461300576b
Commit message:
updated for mbed os 5.4

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-os.lib Show annotated file Show diff for this revision Revisions of this file
mbed-rtos.lib Show diff for this revision Revisions of this file
mbed.bld Show diff for this revision Revisions of this file
diff -r d6461300576b -r bd736256c32d main.cpp
--- a/main.cpp	Wed Mar 09 17:55:01 2016 +0000
+++ b/main.cpp	Mon Apr 03 11:34:50 2017 +0000
@@ -29,7 +29,7 @@
 unsigned long sw1Count = 0;
 unsigned long sw2Count = 0;
 
-void thread1( const void* arg ) 
+void thread1() 
 {
     pc.printf("Entering thread 1\n");
     while (true) {
@@ -57,7 +57,7 @@
     }
 }
 
-void thread2( const void* arg ) 
+void thread2() 
 {
     pc.printf("Entering thread 2\n");  
     while (true) {
@@ -95,8 +95,10 @@
     tidMain = Thread::gettid();  
     
     //Threads
-    Thread t1(thread1);
-    Thread t2(thread2);
+    Thread t1, t2;
+        
+    t1.start(thread1);
+    t2.start(thread2);
     
     pc.printf("Main Thread\n");
     while (true) {
diff -r d6461300576b -r bd736256c32d mbed-os.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Mon Apr 03 11:34:50 2017 +0000
@@ -0,0 +1,1 @@
+https://github.com/ARMmbed/mbed-os/#50b3418e45484ebf442b88cd935a2d5355402d7d
diff -r d6461300576b -r bd736256c32d mbed-rtos.lib
--- a/mbed-rtos.lib	Wed Mar 09 17:55:01 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed-rtos/#b4c5542476ba
diff -r d6461300576b -r bd736256c32d mbed.bld
--- a/mbed.bld	Wed Mar 09 17:55:01 2016 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/252557024ec3
\ No newline at end of file