我有两个线程,需要实现一个新方法run_both,该方法以两个函数为参数,并在一个新线程中调用每个函数。该方法必须返回带有这两个函数的结果的元组。
Thread t1 = new Thread() {
public void run() {
x = y + z;
}
};
Thread t2 = new Thread() {
public void run() {
y = 1;
z = 2;
}
};https://stackoverflow.com/questions/74129753
复制相似问题