git: libc/libpthread: Inject threadsafe locking callbacks for rtld.

Imre Vadasz ivadasz at crater.dragonflybsd.org
Sun Apr 2 12:06:43 PDT 2017


commit 16fb9086b36e7c7d81241bbd6502634e40346c7b
Author: Imre Vadász <imre at vdsz.com>
Date:   Sun Apr 2 13:50:15 2017 +0200

    libc/libpthread: Inject threadsafe locking callbacks for rtld.
    
    * Make rtld thread-safe. Add lib/libthread_xu/thread/thr_rtld.c
      to the build and use it to inject pthread based locking callbacks
      for rtld.
    
    * In rtld_lock.c, do the thread_mask_clear(lock->mask); after releasing
      the actual lock, to avoid deadlocks when rtld is called recursively
      from the pthread locking callbacks.
      XXX An alternative solution for this issue would be, to flag the
          libpthread dynamic library as bind_now to avoid the recursive rtld
          calls.

Summary of changes:
 lib/libthread_xu/Makefile            | 1 +
 lib/libthread_xu/thread/Makefile.inc | 1 +
 lib/libthread_xu/thread/thr_kern.c   | 3 +--
 lib/libthread_xu/thread/thr_rtld.c   | 8 +++++---
 libexec/rtld-elf/rtld_lock.c         | 2 +-
 5 files changed, 9 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/16fb9086b36e7c7d81241bbd6502634e40346c7b


-- 
DragonFly BSD source repository



More information about the Commits mailing list