本文整理汇总了Java中sun.awt.AWTAutoShutdown.notifyToolkitThreadBusy方法的典型用法代码示例。如果您正苦于以下问题:Java AWTAutoShutdown.notifyToolkitThreadBusy方法的具体用法?Java AWTAutoShutdown.notifyToolkitThreadBusy怎么用?Java AWTAutoShutdown.notifyToolkitThreadBusy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sun.awt.AWTAutoShutdown
的用法示例。
在下文中一共展示了AWTAutoShutdown.notifyToolkitThreadBusy方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: WToolkit
import sun.awt.AWTAutoShutdown; //导入方法依赖的package包/类
public WToolkit() {
// Startup toolkit threads
if (PerformanceLogger.loggingEnabled()) {
PerformanceLogger.setTime("WToolkit construction");
}
sun.java2d.Disposer.addRecord(anchor, new ToolkitDisposer());
/*
* Fix for 4701990.
* AWTAutoShutdown state must be changed before the toolkit thread
* starts to avoid race condition.
*/
AWTAutoShutdown.notifyToolkitThreadBusy();
// Find a root TG and attach Appkit thread to it
ThreadGroup rootTG = AccessController.doPrivileged(
(PrivilegedAction<ThreadGroup>) ThreadGroupUtils::getRootThreadGroup);
if (!startToolkitThread(this, rootTG)) {
Thread toolkitThread = new Thread(rootTG, this, "AWT-Windows");
toolkitThread.setDaemon(true);
toolkitThread.start();
}
try {
synchronized(this) {
while(!inited) {
wait();
}
}
} catch (InterruptedException x) {
// swallow the exception
}
// Enabled "live resizing" by default. It remains controlled
// by the native system though.
setDynamicLayout(true);
areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons", "true"));
//set system property if not yet assigned
System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled);
setExtraMouseButtonsEnabledNative(areExtraMouseButtonsEnabled);
}
示例2: WToolkit
import sun.awt.AWTAutoShutdown; //导入方法依赖的package包/类
public WToolkit() {
// Startup toolkit threads
if (PerformanceLogger.loggingEnabled()) {
PerformanceLogger.setTime("WToolkit construction");
}
sun.java2d.Disposer.addRecord(anchor, new ToolkitDisposer());
/*
* Fix for 4701990.
* AWTAutoShutdown state must be changed before the toolkit thread
* starts to avoid race condition.
*/
AWTAutoShutdown.notifyToolkitThreadBusy();
// Find a root TG and attach toolkit thread to it
ThreadGroup rootTG = AccessController.doPrivileged(
(PrivilegedAction<ThreadGroup>) ThreadGroupUtils::getRootThreadGroup);
if (!startToolkitThread(this, rootTG)) {
String name = "AWT-Windows";
Thread toolkitThread = new Thread(rootTG, this, name, 0, false);
toolkitThread.setDaemon(true);
toolkitThread.start();
}
try {
synchronized(this) {
while(!inited) {
wait();
}
}
} catch (InterruptedException x) {
// swallow the exception
}
// Enabled "live resizing" by default. It remains controlled
// by the native system though.
setDynamicLayout(true);
areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons", "true"));
//set system property if not yet assigned
System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled);
setExtraMouseButtonsEnabledNative(areExtraMouseButtonsEnabled);
}
示例3: WToolkit
import sun.awt.AWTAutoShutdown; //导入方法依赖的package包/类
public WToolkit() {
// Startup toolkit threads
if (PerformanceLogger.loggingEnabled()) {
PerformanceLogger.setTime("WToolkit construction");
}
sun.java2d.Disposer.addRecord(anchor, new ToolkitDisposer());
/*
* Fix for 4701990.
* AWTAutoShutdown state must be changed before the toolkit thread
* starts to avoid race condition.
*/
AWTAutoShutdown.notifyToolkitThreadBusy();
if (!startToolkitThread(this)) {
Thread toolkitThread = new Thread(this, "AWT-Windows");
toolkitThread.setDaemon(true);
toolkitThread.start();
}
try {
synchronized(this) {
while(!inited) {
wait();
}
}
} catch (InterruptedException x) {
// swallow the exception
}
SunToolkit.setDataTransfererClassName(DATA_TRANSFERER_CLASS_NAME);
// Enabled "live resizing" by default. It remains controlled
// by the native system though.
setDynamicLayout(true);
areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons", "true"));
//set system property if not yet assigned
System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled);
setExtraMouseButtonsEnabledNative(areExtraMouseButtonsEnabled);
}
示例4: MToolkit
import sun.awt.AWTAutoShutdown; //导入方法依赖的package包/类
public MToolkit() {
super();
if (PerformanceLogger.loggingEnabled()) {
PerformanceLogger.setTime("MToolkit construction");
}
if (!GraphicsEnvironment.isHeadless()) {
String mainClassName = null;
StackTraceElement trace[] = (new Throwable()).getStackTrace();
int bottom = trace.length - 1;
if (bottom >= 0) {
mainClassName = trace[bottom].getClassName();
}
if (mainClassName == null || mainClassName.equals("")) {
mainClassName = "AWT";
}
init(mainClassName);
//SunToolkit.setDataTransfererClassName(DATA_TRANSFERER_CLASS_NAME);
Thread toolkitThread = new Thread(this, "AWT-Motif");
toolkitThread.setPriority(Thread.NORM_PRIORITY + 1);
toolkitThread.setDaemon(true);
PrivilegedAction<Void> a = new PrivilegedAction<Void>() {
public Void run() {
ThreadGroup mainTG = Thread.currentThread().getThreadGroup();
ThreadGroup parentTG = mainTG.getParent();
while (parentTG != null) {
mainTG = parentTG;
parentTG = mainTG.getParent();
}
Thread shutdownThread = new Thread(mainTG, new Runnable() {
public void run() {
shutdown();
}
}, "Shutdown-Thread");
shutdownThread.setContextClassLoader(null);
Runtime.getRuntime().addShutdownHook(shutdownThread);
return null;
}
};
AccessController.doPrivileged(a);
/*
* Fix for 4701990.
* AWTAutoShutdown state must be changed before the toolkit thread
* starts to avoid race condition.
*/
AWTAutoShutdown.notifyToolkitThreadBusy();
toolkitThread.start();
}
}
示例5: WToolkit
import sun.awt.AWTAutoShutdown; //导入方法依赖的package包/类
public WToolkit() {
// Startup toolkit threads
if (PerformanceLogger.loggingEnabled()) {
PerformanceLogger.setTime("WToolkit construction");
}
sun.java2d.Disposer.addRecord(anchor, new ToolkitDisposer());
/*
* Fix for 4701990.
* AWTAutoShutdown state must be changed before the toolkit thread
* starts to avoid race condition.
*/
AWTAutoShutdown.notifyToolkitThreadBusy();
// Find a root TG and attach Appkit thread to it
ThreadGroup rootTG = AccessController.doPrivileged(new PrivilegedAction<ThreadGroup>() {
@Override
public ThreadGroup run() {
return ThreadGroupUtils.getRootThreadGroup();
}
});
if (!startToolkitThread(this, rootTG)) {
Thread toolkitThread = new Thread(rootTG, this, "AWT-Windows");
toolkitThread.setDaemon(true);
toolkitThread.start();
}
try {
synchronized(this) {
while(!inited) {
wait();
}
}
} catch (InterruptedException x) {
// swallow the exception
}
SunToolkit.setDataTransfererClassName(DATA_TRANSFERER_CLASS_NAME);
// Enabled "live resizing" by default. It remains controlled
// by the native system though.
setDynamicLayout(true);
areExtraMouseButtonsEnabled = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons", "true"));
//set system property if not yet assigned
System.setProperty("sun.awt.enableExtraMouseButtons", ""+areExtraMouseButtonsEnabled);
setExtraMouseButtonsEnabledNative(areExtraMouseButtonsEnabled);
}