Skip to main content

rb_internal_thread_specific_key_create

Function rb_internal_thread_specific_key_create 

Source
pub unsafe extern "C" fn rb_internal_thread_specific_key_create() -> rb_internal_thread_specific_key_t
Expand description

Create a key to store thread specific data.

These APIs are designed for tools using rb_internal_thread_event_hook APIs.

Note that only RB_INTERNAL_THREAD_SPECIFIC_KEY_MAX keys can be created. raises ThreadError if exceeded.

Usage: // at initialize time: int tool_key; // gvar Init_tool() { tool_key = rb_internal_thread_specific_key_create; }

§// at any timing: rb_internal_thread_specific_setthread, tool_key, per_thread_data); … per_thread_data = rb_internal_thread_specific_getthread, tool_key);

Generated by rb-sys for Ruby mri-x86_64-linux-gnu-3.3.8