Skip to content

Commit 46d08b2

Browse files
committed
Remove superfluous rtos::ThisThread::yield().
See #45 for more information.
1 parent 543e96a commit 46d08b2

File tree

4 files changed

+1
-23
lines changed

4 files changed

+1
-23
lines changed

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

-6
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ void loop()
3232
Serial.block();
3333
Serial.println("Thread #0: Lorem ipsum ...");
3434
Serial.unblock();
35-
36-
/* If we don't hand back control then the main thread
37-
* will hog the CPU and all other thread's won't get
38-
* time to be executed.
39-
*/
40-
rtos::ThisThread::yield();
4135
}
4236

4337
/**************************************************************************************

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

+1-5
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,5 @@ void setup()
1818

1919
void loop()
2020
{
21-
/* If we don't hand back control then the main thread
22-
* will hog the CPU and all other thread's won't get
23-
* time to be executed.
24-
*/
25-
rtos::ThisThread::yield();
21+
2622
}

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

-6
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,4 @@ void loop()
4040
Serial.println();
4141
Serial.unblock();
4242
}
43-
44-
/* If we don't hand back control then the main thread
45-
* will hog the CPU and all other thread's won't get
46-
* time to be executed.
47-
*/
48-
rtos::ThisThread::yield();
4943
}

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

-6
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,4 @@ void loop()
2626
Serial.print("] Thread #0: Lorem ipsum ...");
2727
Serial.println();
2828
Serial.unblock();
29-
30-
/* If we don't hand back control then the main thread
31-
* will hog the CPU and all other thread's won't get
32-
* time to be executed.
33-
*/
34-
rtos::ThisThread::yield();
3529
}

0 commit comments

Comments
 (0)