- pthread_t thread;
-
-public:
- template<class T, class P = std::pair<T*, void(T::*)()>>
- explicit NativeThread(void(T::*fun)(), T* obj) {
- pthread_attr_t attr_storage, *attr = &attr_storage;
- pthread_attr_init(attr);
- pthread_attr_setstacksize(attr, TH_STACK_SIZE);
- pthread_create(&thread, attr, start_routine<T>, new P(obj, fun));
- }
- void join() { pthread_join(thread, nullptr); }
+ pthread_t thread;
+
+ public:
+ template<class T, class P = std::pair<T*, void (T::*)()>>
+ explicit NativeThread(void (T::*fun)(), T* obj) {
+ pthread_attr_t attr_storage, *attr = &attr_storage;
+ pthread_attr_init(attr);
+ pthread_attr_setstacksize(attr, TH_STACK_SIZE);
+ pthread_create(&thread, attr, start_routine<T>, new P(obj, fun));
+ }
+ void join() { pthread_join(thread, nullptr); }