green rosh / Mbed 2 deprecated resetting_program

Dependencies:   mbed-rtos mbed

Revision:
0:80c3517c7928
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Jun 21 06:46:14 2014 +0000
@@ -0,0 +1,40 @@
+#include "mbed.h"
+#include "rtos.h"
+
+Timer t;
+DigitalOut myled(LED1);
+Serial pc(USBTX,USBRX);
+Thread *thp;
+
+void stuff(void const * args)
+{
+   // int a;
+    while(1)
+    {
+        pc.printf("\nhey \n");
+        t.start();
+        pc.getc();
+        t.stop();
+        t.reset();
+        pc.printf("\nGottil\n");
+    }
+}
+int main() 
+{
+   thp = new Thread(stuff);
+   while(1)
+   {
+       if(t.read()>10.0)
+       {
+            t.stop();
+            t.reset();
+            thp->terminate();
+            delete thp;
+            thp=new Thread(stuff);
+            
+            pc.printf("restarted");
+        }
+       
+    }
+   
+}