summaryrefslogtreecommitdiff
path: root/ACE/examples/Threads/TSS_Data.h
blob: 3c9dfcfe28c7bdc40efcaddabe4d26c3c1630f4a (plain)
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
// $Id$

// ============================================================================
//
// = LIBRARY
//    examples
//
// = FILENAME
//    TSS_Data.cpp
//
// = AUTHOR
//    Prashant Jain and Doug Schmidt
//
// ============================================================================

#include "ace/Singleton.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "ace/Synch_Traits.h"

class TSS_Data
  // = TITLE
  //   Data that is stored in thread-specific storage.
{
public:
  void *data (void) { return this->data_; }
  void data (void *v) { this->data_ = v; }

private:
  // = data_ will be thread-specific data so it doesn't need a lock.
  void *data_;
};

typedef ACE_TSS_Singleton<TSS_Data, ACE_SYNCH_MUTEX> TSS_DATA;