| … | … | @@ -370,7 +370,9 @@ |
| 370 | 370 | ; FYI count-obj returns a pair which might be PAIR, or it |
| 371 | 371 | ; might be a copy of PAIR. If its a copy, its in a different |
| 372 | 372 | ; AtomSpace. Store that one, and not the original. |
| 373 | | (store-value (count-obj 'set-count PAIR CNT) cnt-key)) |
| 373 | (define npr (count-obj 'set-count PAIR CNT)) |
| 374 | (store-value npr cnt-key) |
| 375 | npr) |
| 374 | 376 | |
| 375 | 377 | ; Fully thread-safe fetch-and-increment. |
| 376 | 378 | (define (inc-count PAIR CNT) |
| … | … | @@ -387,7 +389,8 @@ |
| 387 | 389 | (unlock-mutex mtx) |
| 388 | 390 | npr)) |
| 389 | 391 | (count-obj 'inc-count PAIR CNT))) |
| 390 | | (store-value ipr cnt-key)) |
| 392 | (store-value ipr cnt-key) |
| 393 | ipr) |
| 391 | 394 | |
| 392 | 395 | ; Return the observed count for the pair (L-ATOM, R-ATOM). |
| 393 | 396 | ; Be careful to not create tha pair, if it doesn't exist. |