summaryrefslogtreecommitdiff
path: root/ast.c
diff options
context:
space:
mode:
authorKoichi Sasada <[email protected]>2023-11-17 02:29:11 +0900
committerKoichi Sasada <[email protected]>2023-12-08 13:16:19 +0900
commit352a885a0f1a4d4576c686301ee71ea887a345e5 (patch)
treeafb66f30ac5e3056d3cf3b96ca71d5c78b4f77a0 /ast.c
parent9b7a964318d04beb82680ff1d0c6eb571f4b8b5e (diff)
Thread specific storage APIs
This patch introduces thread specific storage APIs for tools which use `rb_internal_thread_event_hook` APIs. * `rb_internal_thread_specific_key_create()` to create a tool specific thread local storage key and allocate the storage if not available. * `rb_internal_thread_specific_set()` sets a data to thread and tool specific storage. * `rb_internal_thread_specific_get()` gets a data in thread and tool specific storage. Note that `rb_internal_thread_specific_get|set(thread_val, key)` can be called without GVL and safe for async signal and safe for multi-threading (native threads). So you can call it in any internal thread event hooks. Further more you can call it from other native threads. Of course `thread_val` should be living while accessing the data from this function. Note that you should not forget to clean up the set data.
Diffstat (limited to 'ast.c')
0 files changed, 0 insertions, 0 deletions