|
From: M H. H. <113...@ho...> - 2006-11-13 00:18:29
|
thus jrate-0.3.7.2-3.3.3
support javax.realtime.OneShotTimer
i can perfectly compile this app with :
jRate-gcj --main=OneShotTimerTest *.java -o OneShotTimerTest
but, when i run it, i got
Exception in thread "main" java.lang.NullPointerException
at javax.realtime.Timer.start() (/mnt/tmp/jRate/lib/libgcj.so.4.0.0)
at OneShotTimerTest.main(java.lang.String[]) (Unknown Source)
i can compile & run PeriodicTimerDemo Smoothly, why i can run this app?
-------------------------------------------------------------------------------------------------
// ************************************************************************
// $Id: OneShotTimerTest.java,v 1.1.1.1 2003/05/19 02:31:37 corsaro Exp $
// ************************************************************************
//
// RTSJBench
//
// Copyright (C) 2001-2003 by Angelo Corsaro.
// <co...@cs...>
// All Rights Reserved.
//
// Permission to use, copy, modify, and distribute this software and
// its documentation for any purpose is hereby granted without fee,
// provided that the above copyright notice appear in all copies and
// that both that copyright notice and this permission notice appear
// in supporting documentation. I don't make any representations
// about the suitability of this software for any purpose. It is
// provided "as is" without express or implied warranty.
//
//
//
// *************************************************************************
//
//
*************************************************************************/
//package rtsj.perf.timer;
import javax.realtime.*;
public class OneShotTimerTest {
static final String TIMEOUT_TIME = "TimeOutTime";
public static void main(String[] args) {
if (args.length < 3) {
System.out.println("USAGE:\n\tOneShotTimerTest <count>
<millis> <nanos> <path>\n");
System.exit(1);
}
final int count = Integer.parseInt(args[0]);
int millis = Integer.parseInt(args[1]); // time in msec
int nanos = Integer.parseInt(args[2]);
Runnable logic = new Runnable() {
public void run() {
}
};
PriorityParameters prioParams =
new PriorityParameters(PriorityScheduler.MAX_PRIORITY);
BoundAsyncEventHandler handler = new
BoundAsyncEventHandler(prioParams, null, null, null, null, false,logic);
OneShotTimer ostimer =
new OneShotTimer(new RelativeTime(millis, nanos),
handler);
ostimer.enable();
for (int i = 0; i < count; i++) {
ostimer.start();
if (i == count - 1)
break;
}
}
}
-----------------------------------------------------------------------------------------------------------
|