public synchronized static int get() {
while(cheia()==false){
try{
wait();
}
catch(InterruptedException e){
}
}
if (fila[inicio] != 0) {
int retornaValor = fila[inicio];
fila[inicio] = 0;
inicio++;
if (inicio == size) {
inicio = 0;
}
notifyAll();
return retornaValor;
}
notifyAll();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
为什么wait()和notifyAll()在这段代码中没有运行?
IDE 说: wait() 方法(或 notifyAll)不是静态的?
你能帮助我吗?
我需要知道如何读取字符串并分成两部分,如下例所示.
我在@amanda文件中有这个字符串:@bruna,但我不能读作单独的单词,而且每个商店都有两个不同的变量,如下所示:
char userA[20];
char userB[20];
scanf("%s:%s", userA, userB);
Run Code Online (Sandbox Code Playgroud)
你能帮助我吗?