Backported r187026 from branches/google/gcc-4_6.

2012-03-12  Richard Guenther  <[email protected]>

	* gthr.h (__GTHREAD_MUTEX_INIT_FUNCTION): Adjust specification.
	* gthr-posix.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.
	(__gthread_mutex_init_function): New function.
	* gthr-single.h (__GTHREAD_MUTEX_INIT_FUNCTION): Define.

	PR gcov/49484
	* libgcov.c: Include gthr.h.
	(__gcov_flush_mx): New global variable.
	(init_mx, init_mx_once): New functions.
	(__gcov_flush): Protect self with a mutex.
	(__gcov_fork): Re-initialize mutex after forking.
	* unwind-dw2-fde.c: Change condition under which to use
	__GTHREAD_MUTEX_INIT_FUNCTION.

BUG=chromium-os:25188
TEST=cbuildbot --remote -g <CL#> chromiumos-sdk

Change-Id: Id032d37e2eb39a35018b8e6f62671a7da73a861e
Reviewed-on: https://gerrit.chromium.org/gerrit/21695
Tested-by: asharif <[email protected]>
Reviewed-by: Han Shen <[email protected]>
Commit-Ready: asharif <[email protected]>
Reviewed-by: asharif <[email protected]>
8 files changed