mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
mjit.c: keep mutex unlocked on destroy
`mjit_finish` may destroy mutex even while it's still locked by `worker` by race condition. That would result in the following error: [BUG] pthread_mutex_destroy: Device or resource busy (EBUSY) Actually I couldn't get a core dump for it and reproduce it multiple times. So I'm not sure this fixes the issue which I faced or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e144481ed5
commit
e28760adff
1 changed files with 1 additions and 2 deletions
3
mjit.c
3
mjit.c
|
@ -926,9 +926,8 @@ worker(void)
|
|||
}
|
||||
}
|
||||
|
||||
CRITICAL_SECTION_START(3, "in the end of worker to update worker_finished");
|
||||
/* To keep mutex unlocked when it is destroyed by mjit_finish, don't wrap CRITICAL_SECTION here. */
|
||||
worker_finished = TRUE;
|
||||
CRITICAL_SECTION_FINISH(3, "in the end of worker to update worker_finished");
|
||||
}
|
||||
|
||||
/* MJIT info related to an existing continutaion. */
|
||||
|
|
Loading…
Add table
Reference in a new issue