Changeset 649 for cpp/common
- Timestamp:
- 02/02/17 15:13:39 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/threads.h
r377 r649 25 25 { 26 26 pthread_key_t mt_key; 27 27 bool destroyed; 28 28 29 public: 29 30 … … 31 32 { 32 33 pthread_key_create(&mt_key, &destructor); 34 destroyed=false; 33 35 } 34 36 … … 37 39 T* o = set(NULL); 38 40 if (o) delete o; 41 destroyed=true; 39 42 } 40 43 … … 54 57 T* get() 55 58 { 59 if (destroyed) { printf("Fatal Error: accessing ThreadSingleton after destroying it\n"); return NULL; } // this will never happen 56 60 T* o = (T*)pthread_getspecific(mt_key); 57 61 if (!o)
Note: See TracChangeset
for help on using the changeset viewer.