调用这段代码(自己实现的一个起等待作用的函数)时,JVM要崩溃:我测试过了,运行到while 里面才崩溃的。
getState()函数返回一个整形 private synchronized boolean waitForState(Processor p, int state) {
p.addControllerListener(new StateListener()); // 为处理器加上状态监听
failed = false; if (state == Processor.Configured) { // 配置处理器
p.configure();
}
else if (state == Processor.Realized) { // 实现处理器
p.realize();
}
// 一直等待,直到成功达到所需状态,或失败
while (p.getState() < state && !failed) {
synchronized (getStateLock()) {
try {
getStateLock().wait();
}
catch (InterruptedException ie) {
return false;
}
}
}
/**
* 内部类:处理器的状态监听器
* */
class StateListener implements ControllerListener {
public void controllerUpdate(ControllerEvent ce) {
// 如果在处理器配置或实现过程中出现错误,它将关闭
if (ce instanceof ControllerClosedEvent) // 控制器关闭
setFailed();
// 对于所有的控制器事件,通知在waitForState方法中等待的线程
if (ce instanceof ControllerEvent) {
synchronized (getStateLock()) {
getStateLock().notifyAll();
}
}
}
}
这是崩溃时控制台提示的信息。
Track 0 is set to transmit as:
dvi/rtp, 22050.0 Hz, 4-bit, Mono
#
# An unexpected error has been detected by Java Runtime Environment:
#
# Internal Error (0xe06d7363), pid=2732, tid=2600
#
# Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86)
# Problematic frame:
# C [kernel32.dll+0x12a5b]
#
# An error report file with more information is saved as:
# D:\Studio\eclipse\workspace\test\hs_err_pid2732.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#[error occurred during error reporting , id 0xc0000005]怎么搞定这个东西?
getState()函数返回一个整形 private synchronized boolean waitForState(Processor p, int state) {
p.addControllerListener(new StateListener()); // 为处理器加上状态监听
failed = false; if (state == Processor.Configured) { // 配置处理器
p.configure();
}
else if (state == Processor.Realized) { // 实现处理器
p.realize();
}
// 一直等待,直到成功达到所需状态,或失败
while (p.getState() < state && !failed) {
synchronized (getStateLock()) {
try {
getStateLock().wait();
}
catch (InterruptedException ie) {
return false;
}
}
}
/**
* 内部类:处理器的状态监听器
* */
class StateListener implements ControllerListener {
public void controllerUpdate(ControllerEvent ce) {
// 如果在处理器配置或实现过程中出现错误,它将关闭
if (ce instanceof ControllerClosedEvent) // 控制器关闭
setFailed();
// 对于所有的控制器事件,通知在waitForState方法中等待的线程
if (ce instanceof ControllerEvent) {
synchronized (getStateLock()) {
getStateLock().notifyAll();
}
}
}
}
这是崩溃时控制台提示的信息。
Track 0 is set to transmit as:
dvi/rtp, 22050.0 Hz, 4-bit, Mono
#
# An unexpected error has been detected by Java Runtime Environment:
#
# Internal Error (0xe06d7363), pid=2732, tid=2600
#
# Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing windows-x86)
# Problematic frame:
# C [kernel32.dll+0x12a5b]
#
# An error report file with more information is saved as:
# D:\Studio\eclipse\workspace\test\hs_err_pid2732.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#[error occurred during error reporting , id 0xc0000005]怎么搞定这个东西?
楼主【newb_f】截止到2008-07-20 11:46:26的历史汇总数据(不包括此帖):
发帖的总数量:7 发帖的总分数:90 每贴平均分数:12
回帖的总数量:26 得分贴总数量:5 回帖的得分率:19%
结贴的总数量:7 结贴的总分数:90
无满意结贴数:3 无满意结贴分:70
未结的帖子数:0 未结的总分数:0
结贴的百分比:100.00% 结分的百分比:100.00%
无满意结贴率:42.86 % 无满意结分率:77.78 %
敬礼!