Skip to content

Commit b12ffb9

Browse files
Add thread-safety warning for CaptureVisionRouter instances in Android and iOS guides
1 parent 2106f95 commit b12ffb9

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

programming/android/foundational-guide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ Add the SDK to your new project. Please read [Add the Libraries](#add-the-librar
298298
}
299299
```
300300

301+
> [!IMPORTANT]
302+
> Instances of `CaptureVisionRouter` are not thread-safe.
303+
> Do not access the same `CaptureVisionRouter` instance from multiple threads concurrently.
304+
> Create a separate instance for each thread if concurrent processing is required.
305+
301306
2. Create a `CapturedResultReceiver` and register with the `CaptureVisionRouter` instance to get recognized barcode results.
302307

303308
<div class="sample-code-prefix"></div>

programming/objectivec-swift/foundational-guide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ func setUpCamera() {
218218
}
219219
```
220220

221+
> [!IMPORTANT]
222+
> Instances of `CaptureVisionRouter` are not thread-safe.
223+
> Do not access the same `CaptureVisionRouter` instance from multiple threads concurrently.
224+
> Create a separate instance for each thread if concurrent processing is required.
225+
221226
2. Implement `onDecodedBarcodesReceived` to receive the barcode decoding results and add this result receiver to the current CVR object.
222227

223228
<div class="sample-code-prefix"></div>

0 commit comments

Comments
 (0)