Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: gcc/gthr-nacl.h

Issue 841313002: Remove hack in __gthread_active_p() to always return 0 on x86_64 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gcc.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Threads compatibility routines for libgcc2 and libobjc. */ 1 /* Threads compatibility routines for libgcc2 and libobjc. */
2 /* Compile this one with gcc. */ 2 /* Compile this one with gcc. */
3 /* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 3 /* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
4 Free Software Foundation, Inc. 4 Free Software Foundation, Inc.
5 5
6 This file is part of GCC. 6 This file is part of GCC.
7 7
8 GCC is free software; you can redistribute it and/or modify it under 8 GCC is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free 9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2, or (at your option) any later 10 Software Foundation; either version 2, or (at your option) any later
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 109
110 static inline int 110 static inline int
111 __gthread_active_p (void) 111 __gthread_active_p (void)
112 { 112 {
113 /* 113 /*
114 * The threading library is active if a basic thread creation/destruction 114 * The threading library is active if a basic thread creation/destruction
115 * primitive is referenced. Unfortunately we don't have those yet. 115 * primitive is referenced. Unfortunately we don't have those yet.
116 * TODO: change to reference a thread creation/destruction function 116 * TODO: change to reference a thread creation/destruction function
117 * when one becomes available. 117 * when one becomes available.
118 */ 118 */
119 // This is a dirty workaround over our inability to use locks in NaCl x86-64.
120 // TODO(pasko): fix this by enabling correct builtins.
121 #ifndef __x86_64__
122 static void *const __gthread_active_ptr 119 static void *const __gthread_active_ptr
123 = __extension__ (void *) &__gthrw_(pthread_mutex_lock); 120 = __extension__ (void *) &__gthrw_(pthread_mutex_lock);
124 return __gthread_active_ptr != 0; 121 return __gthread_active_ptr != 0;
125 #else
126 return 0;
127 #endif
128 } 122 }
129 123
130 #ifdef _LIBOBJC 124 #ifdef _LIBOBJC
131 125
132 /* This is the config.h file in libobjc/ */ 126 /* This is the config.h file in libobjc/ */
133 #include <config.h> 127 #include <config.h>
134 128
135 #ifdef HAVE_SCHED_H 129 #ifdef HAVE_SCHED_H
136 # include <sched.h> 130 # include <sched.h>
137 #endif 131 #endif
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 544
551 static inline int 545 static inline int
552 __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex) 546 __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex)
553 { 547 {
554 return __gthread_mutex_unlock (mutex); 548 return __gthread_mutex_unlock (mutex);
555 } 549 }
556 550
557 #endif /* _LIBOBJC */ 551 #endif /* _LIBOBJC */
558 552
559 #endif /* ! GCC_GTHR_POSIX_H */ 553 #endif /* ! GCC_GTHR_POSIX_H */
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698