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:
parent
d9f6e326ad
commit
dc8c382266
Notes:
git
2024-09-19 09:13:39 +00:00
@ -4234,7 +4234,13 @@ rb_fork_ruby(int *status)
|
|||||||
child.error = err = errno;
|
child.error = err = errno;
|
||||||
|
|
||||||
disable_child_handler_fork_parent(&old); /* yes, bad name */
|
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) {
|
if (pid == 0) {
|
||||||
rb_thread_reset_fork_lock();
|
rb_thread_reset_fork_lock();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user