Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1544)

Side by Side Diff: libgcc/gthr-posix.h

Issue 6151043: Backported r185231 from trunk to google/gcc-4_7. (Closed) Base URL: svn+ssh://gcc.gnu.org/svn/gcc/branches/google/gcc-4_7/
Patch Set: Created 12 years, 11 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « libgcc/gthr.h ('k') | libgcc/gthr-single.h » ('j') | 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 2008, 2009, 2010, 2011 Free Software Foundation, Inc. 4 2008, 2009, 2010, 2011 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 3, or (at your option) any later 10 Software Foundation; either version 3, or (at your option) any later
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 typedef pthread_mutex_t __gthread_mutex_t; 56 typedef pthread_mutex_t __gthread_mutex_t;
57 typedef pthread_mutex_t __gthread_recursive_mutex_t; 57 typedef pthread_mutex_t __gthread_recursive_mutex_t;
58 typedef pthread_cond_t __gthread_cond_t; 58 typedef pthread_cond_t __gthread_cond_t;
59 typedef struct timespec __gthread_time_t; 59 typedef struct timespec __gthread_time_t;
60 60
61 /* POSIX like conditional variables are supported. Please look at comments 61 /* POSIX like conditional variables are supported. Please look at comments
62 in gthr.h for details. */ 62 in gthr.h for details. */
63 #define __GTHREAD_HAS_COND 1 63 #define __GTHREAD_HAS_COND 1
64 64
65 #define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER 65 #define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER
66 #define __GTHREAD_MUTEX_INIT_FUNCTION __gthread_mutex_init_function
66 #define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT 67 #define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT
67 #if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER) 68 #if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER)
68 #define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER 69 #define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER
69 #elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) 70 #elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
70 #define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP 71 #define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
71 #else 72 #else
72 #define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_f unction 73 #define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_f unction
73 #endif 74 #endif
74 #define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER 75 #define __GTHREAD_COND_INIT PTHREAD_COND_INITIALIZER
75 #define __GTHREAD_TIME_INIT {0,0} 76 #define __GTHREAD_TIME_INIT {0,0}
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 #ifdef _GTHREAD_USE_MUTEX_INIT_FUNC 748 #ifdef _GTHREAD_USE_MUTEX_INIT_FUNC
748 static inline void 749 static inline void
749 __gthread_mutex_init_function (__gthread_mutex_t *__mutex) 750 __gthread_mutex_init_function (__gthread_mutex_t *__mutex)
750 { 751 {
751 if (__gthread_active_p ()) 752 if (__gthread_active_p ())
752 __gthrw_(pthread_mutex_init) (__mutex, NULL); 753 __gthrw_(pthread_mutex_init) (__mutex, NULL);
753 } 754 }
754 #endif 755 #endif
755 756
756 static inline int 757 static inline int
758 __gthread_mutex_init_function (__gthread_mutex_t *__mutex)
759 {
760 if (__gthread_active_p ())
761 return __gthrw_(pthread_mutex_init) (__mutex, NULL);
762 return 0;
763 }
764
765 static inline int
757 __gthread_mutex_destroy (__gthread_mutex_t *__mutex) 766 __gthread_mutex_destroy (__gthread_mutex_t *__mutex)
758 { 767 {
759 if (__gthread_active_p ()) 768 if (__gthread_active_p ())
760 return __gthrw_(pthread_mutex_destroy) (__mutex); 769 return __gthrw_(pthread_mutex_destroy) (__mutex);
761 else 770 else
762 return 0; 771 return 0;
763 } 772 }
764 773
765 static inline int 774 static inline int
766 __gthread_mutex_lock (__gthread_mutex_t *__mutex) 775 __gthread_mutex_lock (__gthread_mutex_t *__mutex)
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
903 912
904 static inline int 913 static inline int
905 __gthread_cond_destroy (__gthread_cond_t* __cond) 914 __gthread_cond_destroy (__gthread_cond_t* __cond)
906 { 915 {
907 return __gthrw_(pthread_cond_destroy) (__cond); 916 return __gthrw_(pthread_cond_destroy) (__cond);
908 } 917 }
909 918
910 #endif /* _LIBOBJC */ 919 #endif /* _LIBOBJC */
911 920
912 #endif /* ! GCC_GTHR_POSIX_H */ 921 #endif /* ! GCC_GTHR_POSIX_H */
OLDNEW
« no previous file with comments | « libgcc/gthr.h ('k') | libgcc/gthr-single.h » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b