thr_try_gc unlock and lock again to make sure the lock order. However,
there is no reason for such roundtrip if the caller holds the correct
oder. As a result, we create a new helper function to add the thread
to gc list without unlock + lock and wire the join_common to this new helper.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 78157 Build 75040: arc lint + arc unit
Event Timeline
Comment Actions
The change now takes the thread list write lock unconditionally. Before the change, it only happen if the thread is not referenced. Did you checked that this is innocent?
| lib/libthr/thread/thr_join.c | ||
|---|---|---|
| 96 | This helper as is does not make much sense after your change. Perhaps another helper that does everything up to, but not including, the thr_try_gc() call would be useful, but not this single-use function that can be inlined in the single use place. | |
| 118 | There is no need in tmp, you can assign directly. It is arguably not needed in the join_common_joined(). | |