Defines reentrancy and includes a POSIX listing of a reentrant function.
定义了可重入性,并包含一个可重入函数的POSIX清单。
A reentrant function can be safely called recursively or from multiple tasks.
可再入的函数可以被安全地递归调用或由多任务多次调用。
A reentrant function can be interrupted at any time and resumed at a later time without loss of data.
可重入函数可以在任意时刻被中断,稍后再继续运行,不会丢失数据。
Note that this follows a standard convention for the naming of reentrant function by suffixing the function name with "_r".
注意,这里遵循了标准惯例,通过向函数名添加“_ r”后缀来命名可重入函数。
Due to the asynchronous nature of signals, it is difficult to point out the bug caused when a signal-handling function triggers a non-reentrant function.
由于信号在本质上是异步的,所以难以找出当信号处理函数触发某个不可重入函数时导致的bug。
You can implement the reentrant version of this function by changing the prototype of the function. This listing provides storage for the output string
通过修改函数的原型,您可以实现这个函数的可重入版本。
Returning a pointer to static data may cause a function to be non-reentrant.
返回指向静态数据的指针可能会导致函数不可重入。
If a function USES and modifies an object that you supply, it is potentially non-reentrant; two calls can interfere if they use the same object.
如果某个函数使用并修改了您提供的某个对象,那它可能就是不可重入的;如果两个调用使用同一对象,那么它们会相互干扰。
Remembering the state of the data makes the function non-reentrant.
记忆数据的状态会使函数不可重入。
If the underlying function is in the middle of a critical section and a signal is generated and handled, this can cause the function to be non-reentrant.
如果底层的函数处于关键部分,并且生成并处理信号,那么这可能会导致函数不可重入。
To make it reentrant, the static data, the index variable, needs to be maintained by the caller. The reentrant version of the function could be implemented like this.
为了让它可重入,静态数据,即index,需要由调用者来维护。
To make it reentrant, the static data, the index variable, needs to be maintained by the caller. The reentrant version of the function could be implemented like this.
为了让它可重入,静态数据,即index,需要由调用者来维护。
应用推荐