#  xTimerDelete

**URL:** <https://forums.freertos.org/t/xtimerdelete/7742>\
**Category:** Kernel\
**Created:** [March 19, 2019, 2:20pm UTC](https://forums.freertos.org/t/xtimerdelete/7742 "2019-03-19T14:20:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [March 19, 2019, 2:20pm UTC](https://forums.freertos.org/t/xtimerdelete/7742/1 "2019-03-19T14:20:47Z")

</div>

**[michaeln32](https://sourceforge.net/u/michaeln32/)** wrote on [Tuesday, March 19, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/01f4eb6421/#ed19):

Hi

I create a timer using xTimerCreate().

The timer will run only one time when it reached its expire time.

Can I delete the timer (using xTimerDelete()) in the call back of this timer ?

For example

void timer\_call\_back(void)  
{  
//code  
//code  
//code  
xTimerDelete(timer\_handler,10);  
}

Michael

---

<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:** [March 19, 2019, 3:07pm UTC](https://forums.freertos.org/t/xtimerdelete/7742/2 "2019-03-19T15:07:53Z")

</div>

**[rtel](https://sourceforge.net/u/rtel/)** wrote on [Tuesday, March 19, 2019](https://sourceforge.net/p/freertos/discussion/382005/thread/01f4eb6421/#ed19/0135):

I think (?) it should be possible to delete a timer in its callback BUT  
ONLY if you use a block time of 0. Your code sample is using a block  
time of 10 which will cause a deadlock if the timer command queue is  
full (timer callbacks run in the context of the timer task so if you  
block to post to the timer queue there you are also blocking the task  
that would otherwise make space in the same queue.
