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>2003-12-06 21:08:38 +0300
committerChristopher Faylor <me@cgf.cx>2003-12-06 21:08:38 +0300
commit2b6d15a90833dd2e3aa2aa758813e721fe94a0ca (patch)
tree62d68c6e884f3f1f357148775903a18dc0a58350 /winsup/cygwin/gentls_offsets
parentbdfb870e4afae49b54f98f8486ee04b41b153b28 (diff)
* cygtls.h: Add more "don't parse this" guards.
(_threadinfo::init_thread): Rename from 'init'. (_threadinfo::init): Declare new function. (_threadinfo::protect_linked_list): Declare new critical section. * dcrt0.cc (dll_crt0_1): Call init_thread to initialize thread stuff. (_dll_crt0): Call _threadinfo::init prior to invoking dll_crt0_1. * exceptions.cc (_threadinfo::init_thread): Rename from 'init'. (_threadinfo::init): Define new function. Protect linked list manipulation with new critical section. (_threadinfo::call): Reflect function name change. (_threadinfo::remove): Protect linked list manipulation with new critical section * gentls_offsets: Rework to allow multi-line "don't parse this" protection. * init.cc (dll_entry): Don't remove threads info stuff here since the remove function uses a critical section which can't be used during thread creation or destruction. * thread.cc (pthread::exit): Call _threadinfo remove function here.
Diffstat (limited to 'winsup/cygwin/gentls_offsets')
-rwxr-xr-xwinsup/cygwin/gentls_offsets8
1 files changed, 5 insertions, 3 deletions
diff --git a/winsup/cygwin/gentls_offsets b/winsup/cygwin/gentls_offsets
index fe5fab96e..26432b364 100755
--- a/winsup/cygwin/gentls_offsets
+++ b/winsup/cygwin/gentls_offsets
@@ -5,8 +5,10 @@ open(TLS, $tls) or die "$0: couldn't open tls file \"$tls\" - $!\n";
my $struct = '';
my @fields = ();
my $def = '';
-while (<TLS>) {
- next if $struct && (!/gentls_offsets/o && /\(/o);
+my $tls = join('', <TLS>);
+$tls =~ s/\A.*?gentls_offsets[^\n]*\n//os;
+$tls =~ s%/\*\s*gentls_offsets.*?/\*\s*gentls_offsets\s*\*/%%ogs;
+foreach ($tls =~ /^.*\n/mg) {
$def .= $_ if $struct;
last if /^};/o;
/^\s*typedef/o and do {
@@ -20,7 +22,6 @@ while (<TLS>) {
}
next;
}
- s%/\*\s*gentls_offsets.*/\*\s*gentls_offsets\s*\*/%%og;
s/(?:\[[^\]]*\]|struct|class)//o;
s/^\s+\S+\s+//o;
s/[\*\s()]+//go;
@@ -31,6 +32,7 @@ while (<TLS>) {
close TLS;
open(TMP, '>', "/tmp/$$.cc") or die "$0: couldn't open temporary index file \"/tmp/$$.c\" - $!\n";
print TMP <<EOF;
+#define __attribute__(X)
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>