summaryrefslogtreecommitdiffstats
path: root/lib/libkse/sys/thr_error.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2003-04-18 05:02:39 +0000
committerdeischen <deischen@FreeBSD.org>2003-04-18 05:02:39 +0000
commite68f624d876da04bfb6860b450593c77d80368bd (patch)
tree2febe1cd446be41a73ffb1d52a365735e68244da /lib/libkse/sys/thr_error.c
parent9fe0b6bde601877afbe7ac644d00c3bd6a263502 (diff)
downloadFreeBSD-src-e68f624d876da04bfb6860b450593c77d80368bd.zip
FreeBSD-src-e68f624d876da04bfb6860b450593c77d80368bd.tar.gz
Add FIFO queueing locking operations based on atomic swap.
Modify thread errno for the new libpthread changes. Reviewed by: davidxu
Diffstat (limited to 'lib/libkse/sys/thr_error.c')
-rw-r--r--lib/libkse/sys/thr_error.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/libkse/sys/thr_error.c b/lib/libkse/sys/thr_error.c
index f002ee9..a4a8507 100644
--- a/lib/libkse/sys/thr_error.c
+++ b/lib/libkse/sys/thr_error.c
@@ -34,16 +34,21 @@
* $FreeBSD$
*/
#include <pthread.h>
+#include "libc_private.h"
#include "thr_private.h"
extern int errno;
int * __error()
{
- int *p_errno;
- if (_thread_run == _thread_initial) {
- p_errno = &errno;
- } else {
- p_errno = &_thread_run->error;
+ struct pthread *curthread;
+
+ if (__isthreaded == 0)
+ return (&errno);
+ else {
+ curthread = _get_curthread();
+ if ((curthread == NULL) || (curthread == _thr_initial))
+ return (&errno);
+ else
+ return (&curthread->error);
}
- return(p_errno);
}
OpenPOWER on IntegriCloud