3

作为参考,我正在编写一些代码来手动设置线程的线程优先级(用于学习目的)。我正在使用以下代码:-

final IntByReference cpuset = new IntByReference(1);
final int ret = lib.sched_setaffinity(0,(16),cpuset);
System.out.println(ret);

我编译Java代码如下: -

javac -classpath jna-4.0.0.jar JNATestOne.java 

我收到以下错误:-

JNATestOne.java:27: error: cannot find symbol
          final int ret = lib.sched_setaffinity( 0, cpuMaskSize, new LongByReference( mask ) );
                             ^
  symbol:   method sched_setaffinity(int,int,LongByReference)
  location: variable lib of type CLibrary

我究竟做错了什么?

4

0 回答 0