浏览代码

Document that the timer callback can potentially be called before the timer returns.

Sam Lantinga 2 年之前
父节点
当前提交
14667cc0a3
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      include/SDL3/SDL_timer.h

+ 2 - 2
include/SDL3/SDL_timer.h

@@ -165,7 +165,7 @@ typedef Uint32 (SDLCALL *SDL_TimerCallback)(void *userdata, SDL_TimerID timerID,
  * timer interval. If the value returned from the callback is 0, the timer is
  * timer interval. If the value returned from the callback is 0, the timer is
  * canceled.
  * canceled.
  *
  *
- * The callback is run on a separate thread.
+ * The callback is run on a separate thread, and for short timeouts can potentially be called before this function returns.
  *
  *
  * Timers take into account the amount of time it took to execute the
  * Timers take into account the amount of time it took to execute the
  * callback. For example, if the callback took 250 ms to execute and returned
  * callback. For example, if the callback took 250 ms to execute and returned
@@ -226,7 +226,7 @@ typedef Uint64 (SDLCALL *SDL_NSTimerCallback)(void *userdata, SDL_TimerID timerI
  * timer interval. If the value returned from the callback is 0, the timer is
  * timer interval. If the value returned from the callback is 0, the timer is
  * canceled.
  * canceled.
  *
  *
- * The callback is run on a separate thread.
+ * The callback is run on a separate thread, and for short timeouts can potentially be called before this function returns.
  *
  *
  * Timers take into account the amount of time it took to execute the
  * Timers take into account the amount of time it took to execute the
  * callback. For example, if the callback took 250 ns to execute and returned
  * callback. For example, if the callback took 250 ns to execute and returned