Revert "Remove accidental pinned thread database stuff"

This reverts commit 35b29a39e7920bbbb4d7d9460031fdeec139120f.