Unsafe.debug("Error-sleep "); Unsafe.debug(descr.getId()); Unsafe.debug('\n');
    public void startSystemPlugins(List descriptors) throws PluginException {        SecurityManager sm = System.getSecurityManager();        if (sm != null) {            sm.checkPermission(START_SYSTEM_PLUGINS_PERM);        }                // Resolve all plugins        ((PluginRegistryModel) registry).resolveDescriptors();        ((PluginRegistryModel) registry).resolveDescriptors(descriptors);        // Set the context classloader        Thread.currentThread().setContextClassLoader(                registry.getPluginsClassLoader());        // Start the plugins        final String cmdLine = (String)AccessController.doPrivileged(new GetPropertyAction("jnode.cmdline", ""));        final boolean debug = (cmdLine.indexOf("debug") > 0);        final List<PluginDescriptor> descrList = createPluginDescriptorList();                // Order list by priority        Collections.sort(descrList, new PriorityComparator());        // 2 loops, first start all system plugins,        // then start all auto-start plugins        for (int type = 0; type < 2; type++) {                        for (PluginDescriptor descr : descrList) {                try {                    final boolean start;                    if (type == 0) {                        start = descr.isSystemPlugin();                    } else {                        start = (!descr.isSystemPlugin()) && descr.isAutoStart();                    }                    if (start) {                        if (debug) {                            Unsafe.debug("Debug-sleep\n");                            Thread.sleep(250);                        }                                                startSinglePlugin(descr.getPlugin());                    }                } catch (Throwable ex) {                    BootLog.error("Cannot start " + descr.getId(), ex);                    if (debug) {                        try {                            Unsafe.debug("Error-sleep "); Unsafe.debug(descr.getId()); Unsafe.debug('\n');                            Thread.sleep(5000);                        } catch (InterruptedException ex1) {                            // Ignore                        }                    }                }            }        }        // Wait a while until all plugins have finished their startup process        if (!isStartPluginsFinished()) {            BootLog.info("Waiting for plugins to finished their startprocess");            final long start = System.currentTimeMillis();            long now = start;            int loop = 0;            while (!isStartPluginsFinished() && (now - start < START_TIMEOUT)) {                try {                    if (++loop == 10) {                        System.out.print('.');                        loop = 0;                    }                    Unsafe.debug("wait-sleep\n");                    Thread.sleep(100);                    Unsafe.debug("wait-sleep-returns\n");                } catch (InterruptedException ex) {                    // Ignore                }                now = System.currentTimeMillis();            }            System.out.println();            if (now >= START_TIMEOUT) {                // List all non-finished plugins                listUnfinishedPlugins();            }        }    }