|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2016, 2022, Gluon and/or its affiliates. |
| 2 | + * Copyright (c) 2016, 2023, Gluon and/or its affiliates. |
3 | 3 | * Copyright (c) 2012, 2014, Oracle and/or its affiliates.
|
4 | 4 | * All rights reserved. Use is subject to license terms.
|
5 | 5 | *
|
@@ -373,8 +373,7 @@ public void handleLaunch(List<String> files) {
|
373 | 373 | setApplicationUncaughtExceptionHandler();
|
374 | 374 |
|
375 | 375 | startInBackground("Set up Scene Builder", () -> {
|
376 |
| - backgroundStartPhase0(); |
377 |
| - backgroundStartPhase1(); |
| 376 | + backgroundStart(); |
378 | 377 | setUpUserLibrary(showWelcomeDialog);
|
379 | 378 | createEmptyDocumentWindow();
|
380 | 379 | });
|
@@ -843,34 +842,13 @@ private void performUseToolTheme(ToolTheme toolTheme) {
|
843 | 842 | private String getToolStylesheet() {
|
844 | 843 | return ResourceUtils.getToolStylesheet(toolTheme);
|
845 | 844 | }
|
846 |
| - |
847 |
| - /* |
848 |
| - * Background startup |
849 |
| - * |
850 |
| - * To speed SB startup, we create two threads which anticipate some |
851 |
| - * initialization tasks and offload the JFX thread: |
852 |
| - * - 'Phase 0' thread executes tasks that do not require JFX initialization |
853 |
| - * - 'Phase 1' thread executes tasks that requires JFX initialization |
854 |
| - * |
855 |
| - * Tasks executed here must be carefully chosen: |
856 |
| - * 1) they must be thread-safe |
857 |
| - * 2) they should be order-safe : whether they are executed in background |
858 |
| - * or by the JFX thread should make no difference. |
859 |
| - * |
860 |
| - * Currently we simply anticipate creation of big singleton instances |
861 |
| - * (like Metadata, Preferences...) |
862 |
| - */ |
863 |
| - |
864 |
| - private void backgroundStartPhase0() { |
865 |
| - assert Platform.isFxApplicationThread() == false; // Warning |
866 | 845 |
|
| 846 | + /** |
| 847 | + * This runs in a background thread to speed up SB startup. |
| 848 | + */ |
| 849 | + private void backgroundStart() { |
867 | 850 | PreferencesController.getSingleton();
|
868 | 851 | Metadata.getMetadata();
|
869 |
| - } |
870 |
| - |
871 |
| - private void backgroundStartPhase1() { |
872 |
| - assert Platform.isFxApplicationThread() == false; // Warning |
873 |
| - |
874 | 852 | BuiltinLibrary.getLibrary();
|
875 | 853 | if (EditorPlatform.IS_MAC) {
|
876 | 854 | MenuBarController.getSystemMenuBarController();
|
|
0 commit comments