Boost logo

Threads-Devel :

From: Tony Kay (tkay_at_[hidden])
Date: 2007-08-15 13:21:37

I am the primary developer of AlphaMail (,
which uses Boost libraries for thread support. One of my classes (a
thread pool) was using recursive_mutex. I was playing with Intel's
thread checker, and it gave me a number of errors related to the
thread pool. I carefully examined my code, and could not find a
problem. I looked at the errors in more detail, and noted a serious
problem with Boost: some of the pthread calls were being done with
uninitialized mutex values.

I have not traced down the actual problem in the boost libraries, but
I am attaching the ThreadPool.h class, and the thread checker report
(which has the file/line numbers where problems occurred).

I rebuilt the thing with non-recursive mutexes, and everything is fine
(no problems reported by the thread checker).

Boost: 1.34.1 gcc40-mt-d libraries.

Platform is FC4 Linux (uname -a: Linux
2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 i686
i386 GNU/Linux)

GCC is:

$ gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,java,f95,ada --enable-java-awt=gtk
Thread model: posix
gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)


We are continually faced with a series of great opportunities
brilliantly disguised as insoluble problems.
  - John W. Gardner

Threads-Devel list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at