prepare IDs for Ractor::monitor

To prevent the following strange error, prepare IDs at first.

```
     <internal:ractor>:596:in 'Ractor#monitor': symbol :exited is already registered with 98610c (fatal)
             from <internal:ractor>:550:in 'Ractor#join'
             from <internal:ractor>:574:in 'Ractor#value'
             from bootstraptest.test_ractor.rb_2013_1309.rb:12:in '<main>'
```

BTW, the error should be fixed on ID management system.
This commit is contained in:
Koichi Sasada 2025-05-31 13:13:38 +09:00
parent e8b31c273c
commit 7b75b1f2da
Notes: git 2025-05-31 09:29:16 +00:00
2 changed files with 4 additions and 2 deletions

View File

@ -63,6 +63,8 @@ firstline, predefined = __LINE__+1, %[\
pack
buffer
include?
aborted
exited
_ UScore

View File

@ -533,11 +533,11 @@ ractor_exit_token(bool exc)
{
if (exc) {
RUBY_DEBUG_LOG("aborted");
return ID2SYM(rb_intern("aborted"));
return ID2SYM(idAborted);
}
else {
RUBY_DEBUG_LOG("exited");
return ID2SYM(rb_intern("exited"));
return ID2SYM(idExited);
}
}