/usr/include/ace/TSS_T.inl is in libace-dev 6.3.3+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | // -*- C++ -*-
#include "ace/Thread.h"
#include "ace/Log_Category.h"
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
#if !(defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION)))
template <class TYPE> ACE_INLINE
ACE_TSS<TYPE>::ACE_TSS (TYPE *type)
: type_ (type)
{
}
template <class TYPE> ACE_INLINE int
ACE_TSS<TYPE>::ts_init (void)
{
return 0;
}
template <class TYPE> ACE_INLINE TYPE *
ACE_TSS<TYPE>::ts_object (void) const
{
return this->type_;
}
template <class TYPE> ACE_INLINE TYPE *
ACE_TSS<TYPE>::ts_object (TYPE *type)
{
this->type_ = type;
return this->type_;
}
template <class TYPE> ACE_INLINE TYPE *
ACE_TSS<TYPE>::ts_get (void) const
{
return this->type_;
}
#else
# if defined (ACE_HAS_THR_C_DEST)
template <class TYPE> ACE_INLINE ACE_TSS_Adapter *
ACE_TSS<TYPE>::ts_value (void) const
{
// Get the tss adapter from thread-specific storage
void *temp = 0;
if (ACE_Thread::getspecific (this->key_, &temp) == -1)
{
return 0; // This should not happen!
}
return static_cast <ACE_TSS_Adapter *> (temp);
}
# else
template <class TYPE> ACE_INLINE TYPE *
ACE_TSS<TYPE>::ts_value (void) const
{
void *temp = 0;
if (ACE_Thread::getspecific (this->key_, &temp) == -1)
{
return 0; // This should not happen!
}
return static_cast <TYPE *> (temp);
}
# endif /* ACE_HAS_THR_C_DEST */
# if defined (ACE_HAS_THR_C_DEST)
template <class TYPE> ACE_INLINE int
ACE_TSS<TYPE>::ts_value (ACE_TSS_Adapter *new_tss_adapter) const
{
if (ACE_Thread::setspecific (this->key_,
(void *) new_tss_adapter) != 0)
{
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("Error: ACE_Thread::setspecific() failed!")));
return -1;
}
return 0;
}
# else
template <class TYPE> ACE_INLINE int
ACE_TSS<TYPE>::ts_value (TYPE *new_ts_obj) const
{
if (ACE_Thread::setspecific (this->key_, (void *) new_ts_obj) != 0)
{
ACELIB_ERROR ((LM_ERROR,
ACE_TEXT ("%p\n"),
ACE_TEXT ("Error: ACE_Thread::setspecific() failed!")));
return -1;
}
return 0;
}
# endif /* ACE_HAS_THR_C_DEST */
#endif /* ! (defined (ACE_HAS_THREADS) && (defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION))) */
ACE_END_VERSIONED_NAMESPACE_DECL
|