diff options
| author | Po Lu <luangruo@yahoo.com> | 2023-07-29 11:29:25 +0800 |
|---|---|---|
| committer | Po Lu <luangruo@yahoo.com> | 2023-07-29 11:29:25 +0800 |
| commit | d3e1e188739e54079618405bcc5eb7c6914fecdf (patch) | |
| tree | d22b6f0d659abd04cfdd81537c5c5a739372012a /java/org/gnu/emacs/EmacsSafThread.java | |
| parent | 47f97b5ae49af49ef3adcad4d4d9cab3668002ff (diff) | |
Update Android port
* java/org/gnu/emacs/EmacsSafThread.java (DocIdEntry)
(getCacheEntry, CacheEntry): Use `uptimeMillis' as the basis for
cache expiration.
Diffstat (limited to 'java/org/gnu/emacs/EmacsSafThread.java')
| -rw-r--r-- | java/org/gnu/emacs/EmacsSafThread.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/java/org/gnu/emacs/EmacsSafThread.java b/java/org/gnu/emacs/EmacsSafThread.java index b3d6ab49f6d..9c3e3deb408 100644 --- a/java/org/gnu/emacs/EmacsSafThread.java +++ b/java/org/gnu/emacs/EmacsSafThread.java @@ -151,7 +151,7 @@ public final class EmacsSafThread extends HandlerThread public DocIdEntry () { - time = System.currentTimeMillis (); + time = System.uptimeMillis (); } /* Return a cache entry comprised of the state of the file @@ -208,10 +208,7 @@ public final class EmacsSafThread extends HandlerThread } catch (Throwable e) { - if (e instanceof FileNotFoundException) - return null; - - throw e; + return null; } finally { @@ -223,7 +220,7 @@ public final class EmacsSafThread extends HandlerThread public boolean isValid () { - return ((System.currentTimeMillis () - time) + return ((System.uptimeMillis () - time) < CACHE_INVALID_TIME); } }; @@ -243,13 +240,13 @@ public final class EmacsSafThread extends HandlerThread CacheEntry () { children = new HashMap<String, DocIdEntry> (); - time = System.currentTimeMillis (); + time = System.uptimeMillis (); } public boolean isValid () { - return ((System.currentTimeMillis () - time) + return ((System.uptimeMillis () - time) < CACHE_INVALID_TIME); } }; |
