summaryrefslogtreecommitdiffstats
path: root/lib/libthr
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2013-01-18 23:08:40 +0000
committerjilles <jilles@FreeBSD.org>2013-01-18 23:08:40 +0000
commit3ade1f6acb35053936d191f505bbbf66b6761392 (patch)
tree182ee467e3a771c5ee5b0bca36deadc4db646fd4 /lib/libthr
parent1503599bdce0b577ceb27d1332e6ac5e586389f9 (diff)
downloadFreeBSD-src-3ade1f6acb35053936d191f505bbbf66b6761392.zip
FreeBSD-src-3ade1f6acb35053936d191f505bbbf66b6761392.tar.gz
libthr: Always use the threaded rtld lock implementation.
The threaded rtld lock implementation is faster even in the single-threaded case because it postpones signal handlers via THR_CRITICAL_ENTER and THR_CRITICAL_LEAVE instead of calling sigprocmask(2). As a result, exception handling becomes faster in single-threaded applications linked with libthr. Reviewed by: kib
Diffstat (limited to 'lib/libthr')
-rw-r--r--lib/libthr/thread/thr_init.c6
-rw-r--r--lib/libthr/thread/thr_kern.c5
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c
index c29e8c3..937d83f 100644
--- a/lib/libthr/thread/thr_init.c
+++ b/lib/libthr/thread/thr_init.c
@@ -363,6 +363,12 @@ _libpthread_init(struct pthread *curthread)
_thr_signal_init();
if (_thread_event_mask & TD_CREATE)
_thr_report_creation(curthread, curthread);
+ /*
+ * Always use our rtld lock implementation.
+ * It is faster because it postpones signal handlers
+ * instead of calling sigprocmask(2).
+ */
+ _thr_rtld_init();
}
}
diff --git a/lib/libthr/thread/thr_kern.c b/lib/libthr/thread/thr_kern.c
index 1e7cb51..b5a8358 100644
--- a/lib/libthr/thread/thr_kern.c
+++ b/lib/libthr/thread/thr_kern.c
@@ -57,11 +57,6 @@ _thr_setthreaded(int threaded)
return (0);
__isthreaded = threaded;
- if (threaded != 0) {
- _thr_rtld_init();
- } else {
- _thr_rtld_fini();
- }
return (0);
}
OpenPOWER on IntegriCloud