We got nominated! Help us out and vote for GitHub as Best Bootstrapped Startup of 2008. (You can vote once a day.) [ hide ]

public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Autodetect whether __thread is supported.
Hongli Lai (Phusion) (author)
Thu Jun 19 03:49:29 -0700 2008
commit  c1ba402649c1b59a0b1b450897df070dbf1daf19
tree    d2d36528140cd8f20cbfad469ce9b8127dc3f461
parent  557fdcbd897080770a6e04d1947e8ce7891d3000
...
49
50
51
52
53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
55
 
56
57
58
...
49
50
51
 
 
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 
67
68
69
70
0
@@ -49,10 +49,22 @@ static init_main_thread_tls imtl;
0
 static register_thread_with_backtrace main_thread_registration("Main thread");
0
 static trace_point main_thread_entry_point("main thread entry point", NULL, 0);
0
 
0
-// boost::thread_specific_storage is pretty expensive. So we use the __thread
0
-// keyword whenever possible - that's almost free.
0
+/*
0
+ * boost::thread_specific_storage is pretty expensive. So we use the __thread
0
+ * keyword whenever possible - that's almost free.
0
+ * GCC supports the __thread keyword on x86 since version 3.3. Not sure
0
+ * about other architectures.
0
+ */
0
+
0
+#if defined(__GNUC__) && ( \
0
+ __GNUC__ > 3 || ( \
0
+ __GNUC__ == 3 && __GNUC_MINOR__ >= 3 \
0
+ ) \
0
+)
0
+ #define GCC_IS_3_3_OR_HIGHER
0
+#endif
0
 
0
-#if 1
0
+#ifdef GCC_IS_3_3_OR_HIGHER
0
   static __thread boost::mutex *backtrace_mutex = NULL;
0
   static __thread list<trace_point *> *current_backtrace = NULL;
0
   

Comments

    No one has commented yet.