Boost logo

Boost :

From: Alberto Barbati (abarbati_at_[hidden])
Date: 2002-10-26 08:46:15


Hi Everybody,

I find a couple of trivial bugs while using the singleton_pool class
from the pool library. The first one, in file singleton_pool.hpp causes
a syntax error when instantiating either purge_memory() or
release_memory(). The second one is Win32 specific: there are a few
checks for symbol __WIN32__, disregarding WIN32 and _WIN32 that are more
commonly used.

I attach diffs for both bugs.

Alberto Barbati


*** singleton_pool.hpp Sat Oct 26 08:06:18 2002
--- cvs/base/singleton_pool.hpp Wed Jun 27 22:05:54 2001
***************
*** 105,117 ****
      {
        pool_type & p = singleton::instance();
        details::pool::guard<Mutex> g(p);
! return p.p.release_memory();
      }
      static bool purge_memory()
      {
        pool_type & p = singleton::instance();
        details::pool::guard<Mutex> g(p);
! return p.p.purge_memory();
      }
  };
  
--- 105,117 ----
      {
        pool_type & p = singleton::instance();
        details::pool::guard<Mutex> g(p);
! return p.release_memory();
      }
      static bool purge_memory()
      {
        pool_type & p = singleton::instance();
        details::pool::guard<Mutex> g(p);
! return p.purge_memory();
      }
  };
  


*** mutex.hpp Sat Oct 26 08:06:16 2002
--- cvs/base/mutex.hpp Tue Jun 26 02:01:01 2001
***************
*** 22,28 ****
    // No multithreading -> make locks into no-ops
    #define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_NONE
  #else
! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
      #define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_WIN32
    #else
      #include <unistd.h>
--- 22,28 ----
    // No multithreading -> make locks into no-ops
    #define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_NONE
  #else
! #ifdef __WIN32__
      #define BOOST_MUTEX_HELPER BOOST_MUTEX_HELPER_WIN32
    #else
      #include <unistd.h>
***************
*** 37,43 ****
  #endif
  
  
! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
    #include <windows.h>
  #endif
  #ifdef _POSIX_THREADS
--- 37,43 ----
  #endif
  
  
! #ifdef __WIN32__
    #include <windows.h>
  #endif
  #ifdef _POSIX_THREADS
***************
*** 49,55 ****
  namespace details {
  namespace pool {
  
! #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
  
  class win32_mutex
  {
--- 49,55 ----
  namespace details {
  namespace pool {
  
! #ifdef __WIN32__
  
  class win32_mutex
  {


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