Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-07-01 07:52:33 +0400
committerChristopher Faylor <me@cgf.cx>2000-07-01 07:52:33 +0400
commite337fd40cb296fb3be965be0bf502c272466b0dd (patch)
tree15ec86b07650638ea17984f33cc8292ac1c066da /winsup/cygwin/perthread.h
parent14a3bc2fa10e6d2436331f5bdcf3e2665a616137 (diff)
Forgot perthread.h.
Diffstat (limited to 'winsup/cygwin/perthread.h')
-rw-r--r--winsup/cygwin/perthread.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/winsup/cygwin/perthread.h b/winsup/cygwin/perthread.h
new file mode 100644
index 000000000..fa6e1dfcb
--- /dev/null
+++ b/winsup/cygwin/perthread.h
@@ -0,0 +1,37 @@
+/* perthread.h: Header file for cygwin synchronization primitives.
+
+ Copyright 2000 Cygnus Solutions.
+
+ Written by Christopher Faylor <cgf@cygnus.com>
+
+This file is part of Cygwin.
+
+This software is a copyrighted work licensed under the terms of the
+Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+details. */
+
+#define PTMAGIC 0x77366377
+
+struct _reent;
+extern struct _reent reent_data;
+
+extern DWORD *__stackbase __asm__ ("%fs:4");
+
+extern __inline struct _reent *
+get_reent ()
+{
+ DWORD *base = __stackbase - 1;
+
+ if (*base != PTMAGIC)
+ return &reent_data;
+ return (struct _reent *) base[-1];
+}
+
+extern inline void
+set_reent (struct _reent *r)
+{
+ DWORD *base = __stackbase - 1;
+
+ *base = PTMAGIC;
+ base[-1] = (DWORD) r;
+}