[問題] linux pthread souce code 該哪找
我想找pthread可以用Doxygen建起來的souce code
主要是方便看每個結構的樣子 函式實做的內容
找了一陣子網路上有用Doxygen建起來的應該都是別的平台的
試了gnu的glibc-linuxthreads 看起來也不是能直接用的
大概就是要看這樣的東西
http://www.jbox.dk/sanos/source/include/pthread.h.html
struct pthread_mutex
{
long lock; // Exclusive access to mutex state:
// 0: unlocked/free
// 1: locked - no other waiters
// -1: locked - with possible other waiters
long recursion; // Number of unlocks a thread needs to perform
// before the lock is released (recursive mutexes only)
int kind; // Mutex type
pthread_t owner; // Thread owning the mutex
handle_t event; // Mutex release notification to waiting threads
};typedef struct pthread_mutex pthread_mutex_t;
http://www.jbox.dk/sanos/source/lib/pthread/mutex.c.html
int pthread_mutex_destroy(pthread_mutex_t *mutex)
{
if (!mutex) return EINVAL;
if (close(mutex->event) < 0) return errno;
return 0;
}
謝謝!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 124.10.118.236
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
Programming 近期熱門文章
PTT數位生活區 即時熱門文章