БТ
Size: a a a
БТ
IF
БТ
TM
while (!flag){
Thread.currentThread().yield():
}
БТ
IF
БТ
БТ
БТ
TM
VS
VS
public Object sendMessage(SendMessageOptions options, InputMessageDocument document)
throws InterruptedException {
Object chat = getChat(user.id);
if (!(chat instanceof Chat)) {
createStorageChat();
}
client.send(new TdApi.SendMessage(user.id, 0, options, null, document), object -> {
response = object;
sync.notify();
});
sync.wait();
return response;
}
БТ
TM
public Object sendMessage(SendMessageOptions options, InputMessageDocument document)
throws InterruptedException {
Object chat = getChat(user.id);
if (!(chat instanceof Chat)) {
createStorageChat();
}
client.send(new TdApi.SendMessage(user.id, 0, options, null, document), object -> {
response = object;
synchronized (sync) {
flag = true;
sync.notify();
}
});
synchronized (sync) {
while (!flag) {
sync.wait();
}
}
flag = false;
return response;
}
МК
PM
PM
D
МК