| 7268 | } |
| 7269 | |
| 7270 | void incrementMvccTstamp() |
| 7271 | { |
| 7272 | uint64_t msPrev; |
| 7273 | __atomic_load(&g_pserver->mvcc_tstamp, &msPrev, __ATOMIC_ACQUIRE); |
| 7274 | msPrev >>= MVCC_MS_SHIFT; // convert to milliseconds |
| 7275 | |
| 7276 | long long mst; |
| 7277 | __atomic_load(&g_pserver->mstime, &mst, __ATOMIC_ACQUIRE); |
| 7278 | if (msPrev >= (uint64_t)mst) // we can be greater if the count overflows |
| 7279 | { |
| 7280 | __atomic_fetch_add(&g_pserver->mvcc_tstamp, 1, __ATOMIC_RELEASE); |
| 7281 | } |
| 7282 | else |
| 7283 | { |
| 7284 | uint64_t val = ((uint64_t)mst) << MVCC_MS_SHIFT; |
| 7285 | __atomic_store(&g_pserver->mvcc_tstamp, &val, __ATOMIC_RELEASE); |
| 7286 | } |
| 7287 | } |
| 7288 | |
| 7289 | void OnTerminate() |
| 7290 | { |
no outgoing calls
no test coverage detected