mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Use a single thread for DB access from the UI.
The UI may access the DB in response to UI or DB events; to maintain a consistent view of the DB's contents, the tasks performing these accesses must be prevented from overlapping, and must produce consistent results if reordered. A single-threaded executor and latches are used to prevent tasks from overlapping, without blocking non-UI access to the DB.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
package net.sf.briar.api.android;
|
||||
|
||||
import static java.lang.annotation.ElementType.FIELD;
|
||||
import static java.lang.annotation.ElementType.PARAMETER;
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
import com.google.inject.BindingAnnotation;
|
||||
|
||||
/**
|
||||
* Annotation for injecting the executor for accessing the database from the UI.
|
||||
*/
|
||||
@BindingAnnotation
|
||||
@Target({ FIELD, PARAMETER })
|
||||
@Retention(RUNTIME)
|
||||
public @interface DatabaseUiExecutor {}
|
||||
Reference in New Issue
Block a user