Ruby: include/ruby/thread.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions
thread.h File Reference
`#include "ruby/intern.h"`
`#include "ruby/internal/dllexport.h"`

Go to the source code of this file.

## Macros
#define | RB_NOGVL_INTR_FAIL (0x1)
#define | RB_NOGVL_UBF_ASYNC_SAFE (0x2)
#define | RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
#define | RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_

## Functions
void * | rb_thread_call_with_gvl (void *(*func)(void *), void *data1)
void * | rb_thread_call_without_gvl (void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2)
void * | rb_thread_call_without_gvl2 (void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2)
void * | rb_nogvl (void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2, int flags)

## Detailed Description

Author

Author
  matz

Date
  Tue Jul 10 17:35:43 JST 2012

Copyright
  Copyright (C) 2007 Yukihiro Matsumoto
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Definition in file thread.h.

## Macro Definition Documentation

## ◆ RB_NOGVL_INTR_FAIL

#define RB_NOGVL_INTR_FAIL (0x1)

Definition at line 17 of file thread.h.

## ◆ RB_NOGVL_UBF_ASYNC_SAFE

#define RB_NOGVL_UBF_ASYNC_SAFE (0x2)

Definition at line 18 of file thread.h.

## ◆ RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_

#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_

Definition at line 38 of file thread.h.

## ◆ RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER

#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01

Definition at line 37 of file thread.h.

## Function Documentation

## ◆ rb_nogvl()

void * rb_nogvl | ( | void *(*)(void *) | func,
|  | void * | data1,
|  | rb_unblock_function_t * | ubf,
|  | void * | data2,
|  | int | flags
| ) |  |

Definition at line 1670 of file thread.c.

References BLOCKING_REGION, rb_vm_struct::main_thread, Qfalse, rb_vm_struct::ractor, rb_thread_struct::ractor, RB_NOGVL_INTR_FAIL, RB_NOGVL_UBF_ASYNC_SAFE, rb_ractor_living_thread_num(), rb_thread_kill(), RUBY_UBF_IO, RUBY_UBF_PROCESS, RUBY_VM_CHECK_INTS_BLOCKING, and rb_vm_struct::ubf_async_safe.

Referenced by rb_thread_call_without_gvl(), and rb_thread_call_without_gvl2().

## ◆ rb_thread_call_with_gvl()

void * rb_thread_call_with_gvl | ( | void *(*)(void *) | func,
|  | void * | data1
| ) |  |

Definition at line 1892 of file thread.c.

References rb_unblock_callback::arg, rb_thread_struct::blocking_region_buffer, bp, EXIT_FAILURE, FALSE, rb_unblock_callback::func, if(), rb_bug(), RUBY_ASSERT_ALWAYS, and rb_thread_struct::unblock.

Referenced by ossl_generate_cb_2().

## ◆ rb_thread_call_without_gvl()

void * rb_thread_call_without_gvl | ( | void *(*)(void *) | func,
|  | void * | data1,
|  | rb_unblock_function_t * | ubf,
|  | void * | data2
| ) |  |

Referenced by rb_getaddrinfo(), and rb_getnameinfo().

## ◆ rb_thread_call_without_gvl2()

void * rb_thread_call_without_gvl2 | ( | void *(*)(void *) | func,
|  | void * | data1,
|  | rb_unblock_function_t * | ubf,
|  | void * | data2
| ) |  |

Definition at line 1801 of file thread.c.

References rb_nogvl(), and RB_NOGVL_INTR_FAIL.