Use a shared queue of X items - One thread adds items at random times - The other thread pulls at random times - They need to synchronize when the queue is full (producer) or empty (consumer)!

Revision:
0:180517623995
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-os.lib	Thu Nov 29 17:08:02 2018 +0000
@@ -0,0 +1,1 @@
+https://github.com/armmbed/mbed-os/#bf6f2c3c6434a6de9eb9511feffa5948b3d1f20f