Comments (4)
The first loop is to update the access time inside the 1. Level cache. (if the tile is already loaded).
The second loop is to load missing tiles.
I've added some comments to clarify: 222a07a
from aat.
As my comment says, getHandle()
always calls through to cache.get()
anyway, so you just update the access time twice. I couldn't find any path through getHandle()
that didn't call cache.get()
before doing anything else.
from aat.
The first loop only handles cached tiles. It kind of "reserves" them by setting the access time.
Without this loop it might be possible that, in the second loop, a needed tile gets replaced inside the cache before the call to cache.get()
. Because the second loop can put (replace) tiles into the cache.
You are right that cache.get()
gets called twice, but that is actually intended here.
from aat.
Without this loop it might be possible that, in the second loop, a needed tile gets replaced inside the cache before the call to cache.get()
I don't see any way in which this is possible. The first thing that is done in the second loop is to call getHandle()
on an object of class Tile
. getHandle()
is private
, so it must be the version in TileProvider
which is called.
The first thing that getHandle()
does is to call getTileHandle()
on the same object of class Tile
which was passed to it. getTileHandle()
is also private
, so it must be the version in TileProvider
which is called.
The first thing that getTileHandle()
does is to call cache.get()
on the same object of class Tile
which was passed to it. So there is no way that anything else can happen before cache.get()
is called.
If you're suggesting that another thread can change tilePositions[i].tile
to point to a different object of class Tile
, in that case there was no point in calling cache.get()
in the first loop to set the access time, because you aren't going to access the object of class Tile
that you called it on.
from aat.
Related Issues (20)
- Tiny survey about energy aware software practices. HOT 2
- Holes in cadence in the GPX file HOT 2
- GPX Speed Errors HOT 1
- Altitude not recorded HOT 4
- A display issue HOT 1
- Instant Slope (Feature request) HOT 2
- Very exagerated elevation gain
- AAT tracks a straight line and then tracking stops HOT 2
- [minor bug] GPX-File-Format
- Map orientation - direction of travel, cockpit configuration
- Step sensor in LG G5 stopped working HOT 2
- Bug: Step senzor connected but no steps counted HOT 2
- A confusing widget on "AAT" 's UI HOT 1
- Despite barometer connected, altitude taken from GPS HOT 2
- Possible bugs or documentation issues HOT 3
- Suggestion: add option to keep tracking while app not in foreground HOT 4
- Offline Maps - what format? HOT 1
- Random freezes of tracking HOT 2
- [feature request]: Export/import presets (activities)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aat.