Document thread safety of DiskStore and FlatFileStore

Signed-off-by: Graham <gpe@openrs2.dev>
Graham 4 years ago
parent 20d6d73d30
commit 1455379f20
  1. 2
      cache/src/main/java/dev/openrs2/cache/DiskStore.kt
  2. 4
      cache/src/main/java/dev/openrs2/cache/FlatFileStore.kt

@ -16,6 +16,8 @@ import kotlin.math.min
/** /**
* A [Store] implementation compatible with the native `main_file_cache.dat2` * A [Store] implementation compatible with the native `main_file_cache.dat2`
* and `main_file_cache.idx*` format used by the client. * and `main_file_cache.idx*` format used by the client.
*
* This class is not thread safe.
*/ */
public class DiskStore private constructor( public class DiskStore private constructor(
private val root: Path, private val root: Path,

@ -14,6 +14,10 @@ import java.nio.file.Path
* and groups as file system files. This format is much friendlier to * and groups as file system files. This format is much friendlier to
* content-addressable version control systems, such as Git, than the native * content-addressable version control systems, such as Git, than the native
* format used by the client. * format used by the client.
*
* Multiple read threads may use this class simultaneously. However, only a
* single thread may write at a time. Reads and writes must not happen
* simultaneously.
*/ */
public class FlatFileStore private constructor( public class FlatFileStore private constructor(
private val root: Path, private val root: Path,

Loading…
Cancel
Save