@nxtedition/lib 28.0.15 → 28.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/shared.js +2 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "28.0.15",
3
+ "version": "28.0.16",
4
4
  "license": "UNLICENSED",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "type": "module",
@@ -92,5 +92,5 @@
92
92
  "pino": ">=7.0.0",
93
93
  "rxjs": "^7.0.0"
94
94
  },
95
- "gitHead": "94248f1ed504b65609a9e060335aaabd9d2a0da4"
95
+ "gitHead": "d86a7bb8926d7fd11cc5723b0664803fb078812b"
96
96
  }
package/shared.js CHANGED
@@ -228,7 +228,7 @@ export function writer({ sharedState, sharedBuffer }, { yield: onYield, logger }
228
228
  }
229
229
 
230
230
  if (readPos === 0) {
231
- readPos = Atomics.load(state, READ_INDEX) | 0
231
+ _yield(0)
232
232
  }
233
233
 
234
234
  // Not enough space at the end. Check if there's space at the beginning.
@@ -259,7 +259,7 @@ export function writer({ sharedState, sharedBuffer }, { yield: onYield, logger }
259
259
  // The only free space is between W and R.
260
260
 
261
261
  if (readPos - writePos < required) {
262
- readPos = Atomics.load(state, READ_INDEX) | 0
262
+ _yield(0)
263
263
  }
264
264
 
265
265
  return readPos - writePos >= required
@@ -375,7 +375,6 @@ export function writer({ sharedState, sharedBuffer }, { yield: onYield, logger }
375
375
  if (!_acquire(len)) {
376
376
  const startTime = performance.now()
377
377
  logger?.warn({ readPos, writePos }, 'yield started')
378
- _yield(0)
379
378
  for (let n = 0; !_acquire(len); n++) {
380
379
  if (performance.now() - startTime > timeout) {
381
380
  throw new Error('Timeout while waiting for space in the buffer')