Changeset 348 for cpp/common
- Timestamp:
- 04/09/15 23:51:28 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/threads.h
r346 r348 90 90 }; 91 91 92 #else 92 #else //ifdef MULTITHREADED 93 93 94 94 template<class T> class ThreadSingleton … … 102 102 }; 103 103 104 #endif 104 template<class T> class ThreadSingletonPtr 105 { 106 T *object; 107 108 public: 109 110 ThreadSingletonPtr():object(NULL) {} 111 T* get() {return object;} 112 T* setptr(T* o) {T* previous=object; object=o; return previous;} 113 }; 114 115 #endif //ifdef MULTITHREADED 105 116 106 117 ////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.