c++ - 使用 u_context 结构 - uc_stack.ss_flags 的用途是什么?

标签 c++ linux

我正在尝试使用 getContext() 和 setContext() 在 C++ 应用程序中操作线程。我注意到 ucontext_t 结构有这个字段,uc_stack.ss_flags。这些标志有什么用?我想知道如何将它们用于线程库中的垃圾收集。通常它们默认设置为零。

最佳答案

sigstack.h 中我看到:

/* Possible values for `ss_flags.'.  */
enum
{
  SS_ONSTACK = 1,
#define SS_ONSTACK  SS_ONSTACK
  SS_DISABLE
#define SS_DISABLE  SS_DISABLE
};

搜索这些会将我们带到这里: http://pubs.opengroup.org/onlinepubs/009695399/functions/sigaltstack.html

上面写着:

  • SS_ONSTACK The process is currently executing on the alternate signal stack. Attempts to modify the alternate signal stack while the process is executing on it fail. This flag shall not be modified by processes.
  • SS_DISABLE The alternate signal stack is currently disabled.

关于c++ - 使用 u_context 结构 - uc_stack.ss_flags 的用途是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32773360/

相关文章:

c++ - 如何将应用程序链接到依赖于另一个库的库?

c++ - Eclipse C++ OpenGL - 无法构建项目

c++ - 使用用户输入 C++ 创建 n 个不同的 vector

c++ - BOOST_SPIRIT_DEBUG_NODE 无法在变体节点上编译

linux - 从另一个文件添加列

linux - ubuntu crontab celery 节拍

c - Linux下动态加载库的地址范围

c - 在 C 中使用外部

c++ - 重载数组访问运算符时如何访问 SIMD vector 元素?

c++ - 在GDB中操作以$开头的C++成员变量