This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
This is a patch to implement/use the C++ ABI interface for thread-safeYay!
initialization of local statics. The use generates code something like
-pthread, and it's oh-too-many synonyms?static <type> guard; if (!guard.first_byte) { if (__cxa_guard_acquire (&guard)) { bool flag = false; try { // Do initialization. flag = true; __cxa_guard_release (&guard); // Register variable for destruction at end of program. } catch { if (!flag) __cxa_guard_abort (&guard); } } }
which is more complex than the old code which just checked the first byte
of the guard function. Seems like this should probably be controlled by a
flag, but which?
How do people feel about extending the gthr interface to either supportI vote for both.
recursive mutexes (emulating in the gthr-* file if necessary) or thread_id,
or both?
-- Mark Mitchell CodeSourcery, LLC (916) 791-8304 mark@codesourcery.com
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |