- Timestamp:
- 08/11/09 04:45:10 (4 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
lang/objective-cplusplus/i3/trunk/src/mil/include/mil/ModuleCommon.h
r34815 r34836 82 82 }; 83 83 84 struct AutoJoiner {85 void* obj;86 void (*post_exit)(void*, void*);87 void (*join)(void*);88 char event_memory[sizeof(void*) * 10];89 };90 91 extern int auto_joiner_index;92 extern AutoJoiner auto_joiners[MIL_MAX_THREADS];93 94 84 template <class T> 95 85 void post_exit_template(void* obj, void* event_memory) { … … 108 98 } 109 99 100 struct AutoJoiner { 101 void* obj; 102 void (*post_exit)(void*, void*); 103 void (*join)(void*); 104 char event_memory[sizeof(void*) * 10]; 105 }; 106 107 void set_auto_join_body(AutoJoiner&); 108 void do_auto_join(); 109 110 110 template <class T> 111 111 void set_auto_join(T* t) { 112 auto_joiners[auto_joiner_index].obj = reinterpret_cast<void*>(t); 113 auto_joiners[auto_joiner_index].post_exit = post_exit_template<T>; 114 auto_joiners[auto_joiner_index].join = join_template<T>; 115 auto_joiner_index++; 116 } 117 118 static inline void do_auto_join() { 119 for (int i = 0; i < auto_joiner_index; i++) { 120 auto_joiners[i].post_exit(auto_joiners[i].obj, auto_joiners[i].event_memory); 121 } 122 for (int i = 0; i < auto_joiner_index; i++) { 123 auto_joiners[i].join(auto_joiners[i].obj); 124 } 125 auto_joiner_index = 0; 112 AutoJoiner a = {}; 113 a.obj = reinterpret_cast<void*>(t); 114 a.post_exit = post_exit_template<T>; 115 a.join = join_template<T>; 116 set_auto_join_body(a); 126 117 } 127 118
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)