mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 722575 - make SerialRecordConsumer.consumerIsDone() thread-safe. r=rnewman
This commit is contained in:
parent
7ca96b8ebd
commit
b81d67db7c
@ -49,7 +49,7 @@ import android.util.Log;
|
|||||||
class SerialRecordConsumer extends RecordConsumer {
|
class SerialRecordConsumer extends RecordConsumer {
|
||||||
private static final String LOG_TAG = "SerialRecordConsumer";
|
private static final String LOG_TAG = "SerialRecordConsumer";
|
||||||
protected boolean stopEventually = false;
|
protected boolean stopEventually = false;
|
||||||
private long counter = 0;
|
private volatile long counter = 0;
|
||||||
|
|
||||||
public SerialRecordConsumer(RecordsConsumerDelegate delegate) {
|
public SerialRecordConsumer(RecordsConsumerDelegate delegate) {
|
||||||
this.delegate = delegate;
|
this.delegate = delegate;
|
||||||
@ -130,7 +130,8 @@ class SerialRecordConsumer extends RecordConsumer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void consumerIsDone() {
|
private void consumerIsDone() {
|
||||||
info("Consumer is done. Processed " + counter + ((counter == 1) ? " record." : " records."));
|
long counterNow = this.counter;
|
||||||
|
info("Consumer is done. Processed " + counterNow + ((counterNow == 1) ? " record." : " records."));
|
||||||
delegate.consumerIsDone(stopImmediately);
|
delegate.consumerIsDone(stopImmediately);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user