Skip to content

Commit a1cc560

Browse files
authored
Remove superflous rtos::ThisThread::yield() from main thread 'loop()' (#48)
See #45.
1 parent 4652522 commit a1cc560

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

Diff for: examples/Threading/Demo_Shared_Counter/Demo_Shared_Counter.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ void setup()
66

77
void loop()
88
{
9-
rtos::ThisThread::yield();
9+
1010
}

Diff for: examples/Threading/Demo_Source_Sink_Counter/Demo_Source_Sink_Counter.ino

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ void setup()
1111
Consumer.start();
1212
}
1313

14-
void loop() {
15-
rtos::ThisThread::yield();
14+
void loop()
15+
{
16+
1617
}

Diff for: examples/Threading/Demo_Source_Sink_LED/Demo_Source_Sink_LED.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ void setup()
1313

1414
void loop()
1515
{
16-
rtos::ThisThread::yield();
16+
1717
}

Diff for: examples/Threadsafe_IO/Threadsafe_Wire/Threadsafe_Wire.ino

+1-5
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ void setup()
4545

4646
void loop()
4747
{
48-
/* If we don't hand back control then the main thread
49-
* will hog the CPU and all other thread's won't get
50-
* time to be executed.
51-
*/
52-
rtos::ThisThread::yield();
48+
5349
}
5450

5551
/**************************************************************************************

0 commit comments

Comments
 (0)