Recommended practices for re-entrant code in C, C++

前端 未结 4 1724
半阙折子戏
半阙折子戏 2021-02-06 09:16

I was going through a re-entrancy guide on recommended practices when writing re-entrant code.

What other references and resources cover this topic?

What lint-li

4条回答
  •  無奈伤痛
    2021-02-06 09:37

    1. A reentrant function may not use variables in a non-atomic way unless they are stored on the stack of the calling task or are the private variables of that task.
    2. A reentrant function may not call other functions which are not reentrant.
    3. A reentrant function may not use the hardware in a non-atomic way.

    Ref: Page 462 [AN INTRODUCTION USING THE RENESAS RX62N MICROCONTROLLER] [James M. Conrad]

提交回复
热议问题