)]}'
{
  "commit": "30283b57dfd23f017389f0cfaf9318f7f2469027",
  "tree": "f992ac4346850e7965a53c4c68e5e5bd84bdbb5c",
  "parents": [
    "7ffc6a74655ec8a53fdc28fa1cccc74c1c747ecd"
  ],
  "author": {
    "name": "Rahul Kar",
    "email": "118818625+kar-rahul-aws@users.noreply.github.com",
    "time": "Tue Oct 17 15:05:18 2023 +0530"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Oct 17 15:05:18 2023 +0530"
  },
  "message": "Fix xTaskNotifyWait \u0026 ulTaskNotifyTake determinism. (#833)\n\nThis PR fixes the bug described in the following issue:\r\nhttps://github.com/FreeRTOS/FreeRTOS-Kernel/issues/612.\r\nThis was originally contributed in the following PR:\r\nhttps://github.com/FreeRTOS/FreeRTOS-Kernel/pull/625.\r\n\r\nThe implementation suspends the scheduler before exiting the\r\ncritical section (i.e. before enabling interrupts). If we do not do\r\nso, a notification sent from an ISR, which happens after exiting\r\nthe critical section and before suspending the scheduler, will\r\nget lost. The sequence of events will be:\r\n\r\n1. Exit critical section.\r\n2. Interrupt - ISR calls xTaskNotifyFromISR which adds the task to\r\n    the Ready list.\r\n3. Suspend scheduler.\r\n4. prvAddCurrentTaskToDelayedList moves the task to the delayed\r\n    or suspended list.\r\n5. Resume scheduler does not touch the task (because it is not on\r\n    the pendingReady list), effectively losing the notification from\r\n    the ISR.\r\n\r\nThe same does not happen when we suspend the scheduler before\r\nexiting the critical section. The sequence of events in this case will\r\nbe:\r\n\r\n1. Suspend scheduler.\r\n2. Exit critical section.\r\n3. Interrupt - ISR calls xTaskNotifyFromISR which adds the task to\r\n    the pendingReady list as the scheduler is suspended.\r\n4. prvAddCurrentTaskToDelayedList adds the task to delayed or\r\n    suspended list. Note that this operation does not nullify the add\r\n    to pendingReady list done in the above step because a different\r\n    list item, namely xEventListItem, is used for adding the task to the\r\n    pendingReady list. In other words, the task still remains on the\r\n    pendingReady list.\r\n5. Resume scheduler moves the task from pendingReady list to the Ready list.\r\n\r\n------------\r\n\r\nCo-authored-by: Jacob Carver \u003ckarver8@github.com\u003e\r\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6edf36ff32c3f2d7955b766adbaaab2438b21f91",
      "old_mode": 33188,
      "old_path": "tasks.c",
      "new_id": "e941907cf9c65625ed90d166f38e36144cd159d0",
      "new_mode": 33188,
      "new_path": "tasks.c"
    }
  ]
}
