mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
Fix bug at fork on FreeBSD
The main thread in a forked process appears not to own the read-write lock.
This commit is contained in:
1 file changed
+7
-1
Notes:
git
2024-09-19 09:13:39 +00:00
@@ -4234,7 +4234,13 @@ rb_fork_ruby(int *status)
|
||||
child.error = err = errno;
|
||||
|
||||
disable_child_handler_fork_parent(&old); /* yes, bad name */
|
||||
rb_thread_release_fork_lock();
|
||||
if (
|
||||
#if defined(__FreeBSD__)
|
||||
pid != 0 &&
|
||||
#endif
|
||||
true) {
|
||||
rb_thread_release_fork_lock();
|
||||
}
|
||||
if (pid == 0) {
|
||||
rb_thread_reset_fork_lock();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user