cmcfarlen commented on PR #13999: URL: https://github.com/apache/trafficserver/pull/13999#issuecomment-6982961544
@moonchen Agreed, the one-value-per-type assumption belongs in the type. Done in ff81f9249f: `ThreadLeasedGlobal<T, Tag = T>` has a deleted constructor and static `_ptr`, `_generation` and `thread_local` lease, so `Lease::owner`, the `owner == this` check and the process-wide generation sequence are gone. The remap table is `using RewriteTable = ThreadLeasedGlobal<UrlRewrite>;`, and the tests use a tag per test case. @bryancall Your notes are in the same commit. With a per-type counter, the generation is bumped with `fetch_add(1, std::memory_order_release)`, so a reader that acquires the final generation of overlapping reloads also sees the final table. The idle re-lease test is added (it fails with the expired-lease fallback removed), and the lifetime comment now says the thread's reference to the table ends with its last copy. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
