Boost logo

Boost :

From: Martin Wille (mw8329_at_[hidden])
Date: 2003-11-18 07:34:09


while implementing the alternative_thread_specific_ptr I stumbled
across this:

// in file tss.hpp:
class tss
     bool set(void *);

template <typename T>
class thread_specific_ptr
    void reset(T* p=0)
         T* cur = get();
         if (cur == p) return;
         delete cur;

// in file tss.cpp (POSIX branch):
bool tss::set(void* value)
     return pthread_setspecific(m_key, value) == 0;

and in the POSIX standard:

  No errors are returned from pthread_getspecific().

  The pthread_setspecific() function shall fail if:
    Insufficient memory exists to associate the value with the key.

It seems to me that the result of m_tss.set() should
be checked and an exception should be thrown in case
of a failure.


Boost list run by bdawes at, gregod at, cpdaniel at, john at