This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
pthread_mutex_t initializer idiom
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Fri, 8 Sep 2006 11:55:40 +0200
- Subject: pthread_mutex_t initializer idiom
I'm still trying to unify some of the atomics and concurrency code, and
remove duplicates.
I see this idiom a lot:
__gthread_mutex_t temp = __GTHREAD_MUTEX_INIT;
_M_mutex = temp;
Can somebody explain to me why we are doing this instead of:
_M_mutex = __GTHREAD_MUTEX_INIT;
?
Is this something to do with the gthread abstraction layer and POD mutexes?
-benjamin