结构
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_new
g_mutex_new()
的虚拟函数指针。mutex_lock
g_mutex_lock()
的虚拟函数指针。mutex_trylock
g_mutex_trylock()
的虚拟函数指针。mutex_unlock
g_mutex_unlock()
的虚拟函数指针。mutex_free
g_mutex_free()
的虚拟函数指针。cond_new
g_cond_new()
的虚拟函数指针。cond_signal
g_cond_signal()
的虚拟函数指针。cond_broadcast
g_cond_broadcast()
的虚拟函数指针。cond_wait
g_cond_wait()
的虚拟函数指针。cond_timed_wait
g_cond_timed_wait()
的虚拟函数指针。cond_free
g_cond_free()
的虚拟函数指针。private_new
g_private_new()
的虚拟函数指针。private_get
g_private_get()
的虚拟函数指针。private_set
g_private_set()
的虚拟函数指针。thread_create
g_thread_create()
的虚拟函数指针。thread_yield
g_thread_yield()
的虚拟函数指针。thread_join
g_thread_join()
的虚拟函数指针。thread_exit
g_thread_exit()
的虚拟函数指针。thread_set_priority
g_thread_set_priority()
的虚拟函数指针。thread_self
g_thread_self()
的虚拟函数指针。thread_equal
递归互斥锁和某些断言检查在内部使用。