# Calling xQueueOverwrite from lower priority Task

**URL:** <https://forums.freertos.org/t/calling-xqueueoverwrite-from-lower-priority-task/15333>\
**Category:** Kernel\
**Created:** [June 27, 2022, 3:13pm UTC](https://forums.freertos.org/t/calling-xqueueoverwrite-from-lower-priority-task/15333 "2022-06-27T15:13:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitpatrol](https://avatars.discourse-cdn.com/v4/letter/b/2acd7d/32.png) [@bitpatrol](https://forums.freertos.org/u/bitpatrol)\
**Post date:** [June 27, 2022, 3:13pm UTC](https://forums.freertos.org/t/calling-xqueueoverwrite-from-lower-priority-task/15333/1 "2022-06-27T15:13:00Z")

</div>

If a lower priority task writes to a mailbox queue using xQueueOverwrite(), will it be thread safe and atomic even if a higher priority task interrupts the lower priority task as it is calling xQueueOverwrite() or will the lower priority task finish calling xQueueOverwrite() before the scheduler switches context?

---

<div class="post-metadata">

**Author:** ![rtel](https://d3iykfbgfh8zhg.cloudfront.net/user_avatar/forums.freertos.org/rtel/32/31_2.png) [@rtel](https://forums.freertos.org/u/rtel)\
**Post date:** [June 27, 2022, 3:38pm UTC](https://forums.freertos.org/t/calling-xqueueoverwrite-from-lower-priority-task/15333/2 "2022-06-27T15:38:05Z")

</div>

All the FreeRTOS APIs are thread safe.
