Should be reentrant , because it is called on 指定的方法应是可重入的,这是因为
If it were , we would have to protect ourselves with (如果它是多线程的或可重入的,则必须用
It is acceptable because our test framework is not multithreaded or reentrant 这是可以接受的,因为我们的测试框架不是多线程的或可重入的。
Are not reentrant , because they use a static data structure that records which memory blocks are free 都不是可重入的,因为它们使用静态数据结构来记录哪些内存块是空闲的。
From the programmer perspective , these two are separate concepts : a function can be reentrant , thread - safe , both , or neither 在程序员看来,这是两个独立的概念:函数可以是可重入的,是线程安全的,或者二者皆是,或者二者皆非。
Things become even more complicated when you re using a third - party library , because you never know which parts of the library are reentrant and which are not 如果使用第三方程序库,事情会变得更为复杂,因为您永远不知道哪部分程序库是可重入的,哪部分是不可重入的。
That s because only a few system calls can be safely called inside signals . only calls that are re - entrant or not interruptible by signals can be called safely 那是因为只有一些系统调用可以安全地调用内部信号:只有可重入的( re - entrant )或者不被信号中断的调用才可以被安全地调用。
Atomicity is straightforward enough - synchronization enforces a reentrant mutex , preventing more than one thread from executing a block of code protected by a given monitor at the same time 原子性非常简单同步实施一个可重入的( reentrant )互斥,防止多于一个的线程同时执行由一个给定的监视器保护的代码块。