cacheserver: Add locking to the LRU

The cache server will crash if two requests come in at the same time
because the lack of locking. This change adds a mutex. I haven't seen
the cache server crash since adding this.

BUG=b:390255027
TEST=run cache server w/ foil-provision.

Change-Id: Iaeb3c8d49d279c2a45faf45ffcb00b7666f7d9b3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/7013788
Auto-Submit: Raul Rangel <[email protected]>
Reviewed-by: Seewai Fu <[email protected]>
Commit-Queue: Raul Rangel <[email protected]>
Tested-by: Raul Rangel <[email protected]>
1 file changed