![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Demonstration of a spin lock
Dependencies: ELEC350-Practicals-FZ429
Fork of Task617Solution-mbedos-FZ429 by
Diff: main.cpp
- Revision:
- 6:d16ce38e9b8a
- Parent:
- 5:31707531f715
- Child:
- 7:bd75e7717b58
--- a/main.cpp Wed Mar 09 17:55:53 2016 +0000 +++ b/main.cpp Mon Apr 03 11:38:04 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) { @@ -97,8 +97,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) {