title: FreeRTOS vs Zephyr/Mynewt task blocked state
body: <p>I cannot seem to find any info on this question, so I thought I'd ask here.
  (No reply here: <a href="https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-June/007743.html" rel="nofollow noreferrer">https://lists.zephyrproject.org/pipermail/zephyr-devel/2017-June/007743.html</a>)</p>
  
  <p>When a driver (eg. SPI or UART) is invoked through
  FreeRTOS using the vendor HAL, then there
  are two options for waiting upon completion:</p>
  
  <p>1) Interrupt
  2) busy-waiting</p>
  
  <p><strong>My question is this:</strong></p>
  
  <p>If the driver is invoked using busy-waiting; Does FreeRTOS then have any knowledge of the busy-waiting (occuring in the HAL Driver)? Does the task still get a time slot allocated (for doing busy-waiting). Is this
  how it works? (Presuming FreeRTOS task has a preemptive scheduler)</p>
  
  <p>Now in Zephyr (and probably Mynewt), I can see that when the driver is called, Zephyr keeps track of the calling task, which is then suspended (blocked state) until finished. Then the driver interrupt routine it puts the calling thread into the run-queue, when ready to proceed. This way no cycles are waisted. Is this correct understood?</p>
  
  <p>Thanks
  Anders</p>