summaryrefslogtreecommitdiffstats
path: root/lib/libthr/sys
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2005-04-02 01:20:00 +0000
committerdavidxu <davidxu@FreeBSD.org>2005-04-02 01:20:00 +0000
commitf066519e91e2290cb79ef12fe7c958ee462cda6c (patch)
tree6aaef5f553a6539306bd6f5679d039ed3c2abcce /lib/libthr/sys
parent3cc412b7837a105c757df856c422eb5f497bad67 (diff)
downloadFreeBSD-src-f066519e91e2290cb79ef12fe7c958ee462cda6c.zip
FreeBSD-src-f066519e91e2290cb79ef12fe7c958ee462cda6c.tar.gz
Import my recent 1:1 threading working. some features improved includes:
1. fast simple type mutex. 2. __thread tls works. 3. asynchronous cancellation works ( using signal ). 4. thread synchronization is fully based on umtx, mainly, condition variable and other synchronization objects were rewritten by using umtx directly. those objects can be shared between processes via shared memory, it has to change ABI which does not happen yet. 5. default stack size is increased to 1M on 32 bits platform, 2M for 64 bits platform. As the result, some mysql super-smack benchmarks show performance is improved massivly. Okayed by: jeff, mtm, rwatson, scottl
Diffstat (limited to 'lib/libthr/sys')
-rw-r--r--lib/libthr/sys/Makefile.inc4
-rw-r--r--lib/libthr/sys/thr_error.c19
2 files changed, 9 insertions, 14 deletions
diff --git a/lib/libthr/sys/Makefile.inc b/lib/libthr/sys/Makefile.inc
index 59018f7..70c6dda 100644
--- a/lib/libthr/sys/Makefile.inc
+++ b/lib/libthr/sys/Makefile.inc
@@ -1,5 +1,5 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/sys ${.CURDIR}/arch/${MACHINE_ARCH}/${MACHINE_ARCH}
+.PATH: ${.CURDIR}/sys
-SRCS+= thr_error.c
+SRCS+= thr_error.c
diff --git a/lib/libthr/sys/thr_error.c b/lib/libthr/sys/thr_error.c
index 726c0df..902c054 100644
--- a/lib/libthr/sys/thr_error.c
+++ b/lib/libthr/sys/thr_error.c
@@ -35,25 +35,20 @@
*/
#include <pthread.h>
+
+#include "libc_private.h"
#include "thr_private.h"
#undef errno
extern int errno;
-__weak_reference(___error, __error);
-
int *
-___error()
+__error(void)
{
- struct pthread *pthread;
-
- if (_thread_initial == NULL)
- return (&errno);
-
- pthread = _get_curthread();
+ struct pthread *curthread = _get_curthread();
- if (pthread == _thread_initial)
+ if (curthread != NULL && curthread != _thr_initial)
+ return (&curthread->error);
+ else
return (&errno);
-
- return (&pthread->error);
}
OpenPOWER on IntegriCloud