Boost logo

Boost :

From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2001-09-08 12:45:45


Before the time runs out, I've looked briefly at threadcorrect1.zip.

The library should be accepted into boost.

 - Most of tss.cpp is wrapped into BOOST_HAS_WINTHREADS,
but the #include "threadmon.hpp" is not, which makes the
compilation fail (or is tss.cpp not supposed to be compiled
on POSIX at all?)

 - The new config system should base BOOST_HAS_THREADS
on the compiler ("does the compiler support threads at
all"), and BOOST_HAS_xxxTHREADS on the platform ("what
does the interface look like"). Similarly, nanosleep
and gettimeofday are platform (or probably library)
concerns.

 - xtime.hpp uses "boost/stdint.h", which is deprecated
and fails with como on my Linux box. Use "boost/cstdint.hpp"
instead (need to fix uintXX_t usage in the code as well).

 - Please add a newline at the end of once.hpp

 - Something needs to be declared "extern C", or a wrapper added:
"once.cpp", line 45: error: argument of type "void (*)()" is incompatible with
          parameter of type "void (*)() C"
        pthread_once(&flag, func);
                            ^

"thread.cpp", line 103: error: argument of type "void *(*)(void *)" is
          incompatible with parameter of type "void *(*)(void *) C"
      int res = pthread_create(&m_thread, 0, &thread_proxy, &param);
                                             ^

"tss.cpp", line 134: error: argument of type "void (*)(void *)" is
          incompatible with parameter of type "void (*)(void *) C"
      int res = pthread_key_create(&m_key, cleanup);
                                           ^

 - If you need to add "extern C" to some function definitions, do make
sure to give those implementation-detail functions "static" linkage.
An unnamed namespace won't cut it, because the namespace is not
coded in the function name for "extern C" functions.

 - I'm unsure why I get these:
"tss.cpp", line 134: error: argument of type "void (*)(void *)" is
          incompatible with parameter of type "void (*)(void *) C"
      int res = pthread_key_create(&m_key, cleanup);
                                           ^

"tss.cpp", line 135: error: identifier "__assert_fail" is undefined
      assert(res == 0);
      ^

"tss.cpp", line 144: error: identifier "__assert_fail" is undefined
      assert(res == 0);
      ^

 - Please fix the indentation in timeconv.inl, it looks ugly
with 8 char tabstops. Oh yes, boost tends to avoid tabs at all.

 - I notice that thread.hpp includes pthread.h, but only
thread.cpp includes "windows.h". This is asymmetric, but probably
required, and not too grave.

Jens Maurer


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk