1 /* |
1 /* |
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
326 protected static final void waitBackgroundCompilation(Executable executable) { |
326 protected static final void waitBackgroundCompilation(Executable executable) { |
327 if (!BACKGROUND_COMPILATION) { |
327 if (!BACKGROUND_COMPILATION) { |
328 return; |
328 return; |
329 } |
329 } |
330 final Object obj = new Object(); |
330 final Object obj = new Object(); |
331 for (int i = 0; i < 10 |
331 for (int i = 0; i < 100 |
332 && WHITE_BOX.isMethodQueuedForCompilation(executable); ++i) { |
332 && WHITE_BOX.isMethodQueuedForCompilation(executable); ++i) { |
333 synchronized (obj) { |
333 synchronized (obj) { |
334 try { |
334 try { |
335 obj.wait(1000); |
335 obj.wait(100); |
336 } catch (InterruptedException e) { |
336 } catch (InterruptedException e) { |
337 Thread.currentThread().interrupt(); |
337 Thread.currentThread().interrupt(); |
338 } |
338 } |
339 } |
339 } |
340 } |
340 } |