summaryrefslogtreecommitdiffstats
path: root/luni-kernel/src
diff options
context:
space:
mode:
authorAndy McFadden <>2009-04-08 12:51:10 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-08 12:51:10 -0700
commita327fd2c0aea1dbcf341393a44d07031ac4bcf38 (patch)
tree9667f4a013556028d00d9c81dd5042ddf2905a17 /luni-kernel/src
parentb24c3855b72e1e4e1c11629db3faf89b73be7dea (diff)
downloadlibcore-a327fd2c0aea1dbcf341393a44d07031ac4bcf38.zip
libcore-a327fd2c0aea1dbcf341393a44d07031ac4bcf38.tar.gz
libcore-a327fd2c0aea1dbcf341393a44d07031ac4bcf38.tar.bz2
AI 145086: Use process groups to avoid a collision between dexopt and ProcessManager.
If the ProcessManager thread was waiting for a child process to finish, it could inadvertently capture the exit status of dexopt. This confused the VM somewhat. With this change the dexopt child runs in its own process group, and the ProcessManager only waits for children in the parent's process group. I also now create a new process in the DexClassLoader test to check for clashes. (It's a race, but it nearly always hits on the device, and occasionally hits on desktop.) BUG=1777736 Automated import of CL 145086
Diffstat (limited to 'luni-kernel/src')
-rw-r--r--luni-kernel/src/main/native/java_lang_ProcessManager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/luni-kernel/src/main/native/java_lang_ProcessManager.c b/luni-kernel/src/main/native/java_lang_ProcessManager.c
index ee2fc58..a572237 100644
--- a/luni-kernel/src/main/native/java_lang_ProcessManager.c
+++ b/luni-kernel/src/main/native/java_lang_ProcessManager.c
@@ -91,7 +91,8 @@ static void java_lang_ProcessManager_watchChildren(JNIEnv* env, jobject o) {
while (1) {
int status;
- pid_t pid = wait(&status);
+ /* wait for children in our process group */
+ pid_t pid = waitpid(0, &status, 0);
if (pid >= 0) {
// Extract real status.