Recursive lock is supported by the commit: rG456a3a8e93ea: gpg: Fix trustdb updates without lock held.
for T3839
But it was actually supported in a different way by the take_write_lock which was introduced by the commit: rGfe5c6edaed78: g10: Fix a race condition initially creating trustdb.
for T1675
Before the is_locked is introduced, it was the caller which takes care of recursive locking; It remains the code in tdbio_sync, where it checks the return value of take_write_lock (and remember with did_lock), and only call release_write_lock when did_lock is true.
This did_lock thing should be removed now. Currently, when recursive lock happens in tdbio_sync, the lock remains (until cleanup by exit).