summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-04 13:14:11 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-04 13:14:11 +0000
commit23444302d9200bcc41ce279a529f73cad63c3f05 (patch)
treecb541d972fd43a434593dca6c3aebcfcdd8fe560 /vm_core.h
parent16cfd26a57c30e17bc3c116c83134420693ba5c4 (diff)
introduce rb_nogvl C-API to mark ubf as async-signal-safe
zlib and bignum both contain unblocking functions which are async-signal-safe and do not require spawning additional threads. We can execute those functions directly in signal handlers without incurring overhead of extra threads, so provide C-API users the ability to deal with that. Other C-API users may have similar need. This flexible API can supercede existing uses of rb_thread_call_without_gvl and rb_thread_call_without_gvl2 by introducing a flags argument to control behavior. Note: this API is NOT finalized. It needs approval from other committers. I prefer shorter name than previous rb_thread_call_without_gvl* functions because my eyes requires big fonts. [Bug #15499] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/vm_core.h b/vm_core.h
index ea59e417ef..7852ca4625 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -608,6 +608,9 @@ typedef struct rb_vm_struct {
VALUE thgroup_default;
int living_thread_num;
+ /* set in single-threaded processes only: */
+ volatile int ubf_async_safe;
+
unsigned int running: 1;
unsigned int thread_abort_on_exception: 1;
unsigned int thread_report_on_exception: 1;