结构
GLibThreadFunctions
描述 [src]
struct GThreadFunctions {
GMutex* (* mutex_new) (
void
);
void (* mutex_lock) (
GMutex* mutex
);
gboolean (* mutex_trylock) (
GMutex* mutex
);
void (* mutex_unlock) (
GMutex* mutex
);
void (* mutex_free) (
GMutex* mutex
);
GCond* (* cond_new) (
void
);
void (* cond_signal) (
GCond* cond
);
void (* cond_broadcast) (
GCond* cond
);
void (* cond_wait) (
GCond* cond,
GMutex* mutex
);
gboolean (* cond_timed_wait) (
GCond* cond,
GMutex* mutex,
GTimeVal* end_time
);
void (* cond_free) (
GCond* cond
);
GPrivate* (* private_new) (
GDestroyNotify destructor
);
gpointer (* private_get) (
GPrivate* private_key
);
void (* private_set) (
GPrivate* private_key,
gpointer data
);
void (* thread_create) (
GThreadFunc func,
gpointer data,
gulong stack_size,
gboolean joinable,
gboolean bound,
GThreadPriority priority,
gpointer thread,
GError** error
);
void (* thread_yield) (
void
);
void (* thread_join) (
gpointer thread
);
void (* thread_exit) (
void
);
void (* thread_set_priority) (
gpointer thread,
GThreadPriority priority
);
void (* thread_self) (
gpointer thread
);
gboolean (* thread_equal) (
gpointer thread1,
gpointer thread2
);
}
此函数表不再由 g_thread_init() 用于初始化线程系统。
结构成员
mutex_newg_mutex_new()的虚拟函数指针。mutex_lockg_mutex_lock()的虚拟函数指针。mutex_trylockg_mutex_trylock()的虚拟函数指针。mutex_unlockg_mutex_unlock()的虚拟函数指针。mutex_freeg_mutex_free()的虚拟函数指针。cond_newg_cond_new()的虚拟函数指针。cond_signalg_cond_signal()的虚拟函数指针。cond_broadcastg_cond_broadcast()的虚拟函数指针。cond_waitg_cond_wait()的虚拟函数指针。cond_timed_waitg_cond_timed_wait()的虚拟函数指针。cond_freeg_cond_free()的虚拟函数指针。private_newg_private_new()的虚拟函数指针。private_getg_private_get()的虚拟函数指针。private_setg_private_set()的虚拟函数指针。thread_createg_thread_create()的虚拟函数指针。thread_yieldg_thread_yield()的虚拟函数指针。thread_joing_thread_join()的虚拟函数指针。thread_exitg_thread_exit()的虚拟函数指针。thread_set_priorityg_thread_set_priority()的虚拟函数指针。thread_selfg_thread_self()的虚拟函数指针。thread_equal递归互斥锁和某些断言检查在内部使用。