“错误:无效使用非静态数据成员‘thread::tfun’” Class thread { typedef void* (th_fun) (void*); th_fun *tfun; void create(th_fun *fun=tfun) { pthread_create(&t, NULL, fun, NULL); } } 如何在类中使用函数指针?请注意:-静态减速会使代码编译。但我的要求是保持每个对象的函数。 浏览1...
typedef struct pthread_t { void *handle; void *(*func)(void* arg); void *arg; Expand All @@ -56,7 +56,7 @@ typedef CRITICAL_SECTION pthread_mutex_t; /* This is the CONDITIONAL_VARIABLE typedef for using Window's native * conditional variables on kernels 6.0+. * MinGW does not ...