1
0
Fork 0
mirror of https://github.com/geometer/FBReaderJ.git synced 2025-10-05 10:49:24 +02:00

lower priority for library building

This commit is contained in:
Nikolay Pultsin 2011-07-23 01:26:38 +01:00
parent ab0f51bda7
commit 0defdc0df3

View file

@ -434,7 +434,7 @@ public final class Library {
public void startBuild() {
setStatus(myStatusMask | STATUS_LOADING);
new Thread("Library.build") {
final Thread builder = new Thread("Library.build") {
public void run() {
try {
build();
@ -442,7 +442,9 @@ public final class Library {
setStatus(myStatusMask & ~STATUS_LOADING);
}
}
}.start();
};
builder.setPriority((Thread.MIN_PRIORITY + Thread.NORM_PRIORITY) / 2);
builder.start();
}
public boolean isUpToDate() {
@ -461,7 +463,7 @@ public final class Library {
public void startBookSearch(final String pattern) {
setStatus(myStatusMask | STATUS_SEARCHING);
new Thread("Library.searchBooks") {
final Thread searcher = new Thread("Library.searchBooks") {
public void run() {
try {
searchBooks(pattern);
@ -469,7 +471,9 @@ public final class Library {
setStatus(myStatusMask & ~STATUS_SEARCHING);
}
}
}.start();
};
searcher.setPriority((Thread.MIN_PRIORITY + Thread.NORM_PRIORITY) / 2);
searcher.start();
}
private void searchBooks(String pattern) {