1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-13 15:00:42 -08:00

Avoid caching file status when they are about to change

* java/org/gnu/emacs/EmacsSafThread.java (EmacsSafThread)
(cacheFileStatus): New argument NO_CACHE.
(cacheDirectoryFromCursor, statDocument1):
* java/org/gnu/emacs/EmacsService.java (EmacsService)
(statDocument): Plumb that argument through each of these wrapper
functions.
* src/android.c (android_init_emacs_service): Adjust JNI
function signatures to agree with statDocument1.
* src/androidvfs.c (android_saf_stat): Plumb that argument
through here.
(android_saf_tree_stat, android_saf_file_open): And don't cache
file status if a write is imminent.
This commit is contained in:
Po Lu 2023-08-08 16:17:10 +08:00
parent 27113c22f7
commit 440f017658
4 changed files with 41 additions and 19 deletions

View file

@ -1389,11 +1389,14 @@ public final class EmacsService extends Service
last modification to this file in milliseconds since 00:00,
January 1st, 1970.
If NOCACHE, refrain from placing the file status within the
status cache.
OperationCanceledException and other typical exceptions may be
signaled upon receiving async input or other errors. */
public long[]
statDocument (String uri, String documentId)
statDocument (String uri, String documentId, boolean noCache)
{
/* Start the thread used to run SAF requests if it isn't already
running. */
@ -1404,7 +1407,7 @@ public final class EmacsService extends Service
storageThread.start ();
}
return storageThread.statDocument (uri, documentId);
return storageThread.statDocument (uri, documentId, noCache);
}
/* Find out whether Emacs has access to the document designated by