Linux C notes (BOOK UNIX)
Chapter 1: Thread
① thread functions
1. pthread_self();
2. thread existing
you can get the value of rval_ptr just by pthread_join(pthread_t tht, void ** rval_ptr)
cancel a thread as the thread exits with PTHREAD_CANCELED in pthread_exit, this function only send a signal but not wait until the thread really exits
We can give a function to a thread with which the thread can invoke it when it exits. This
pthread_clean_push
These two functions must be in pairs in your function routines but not in the main function. And one thing should be mentioned as : the routine should not be returned but
pthread_detach(pthread_t tid)
4. Thread synchronization of thread
② thread. synchronics
pthread_mutex_t variable
pthread_mutex_destroy()
ii. Lock
pthread_mutex_trylock() return instantly
pthread_unlock()
pthread_rwlook_t
pthread_rwlock_init
pthread_rwlock_destroy
ii. Lock
pthread_rwlock_wrlook
pthread_rwlock_unlock
pthread_rwlock_tryrdlock
pthread_rwlock_trywrlock
3. Cond
i. initiation
pthread_cond_init(&pcndt, attr);
相关文档:
例一:发送Signaling Packet:
Signaling Command是2个Bluetooth实体之间的L2CAP层命令传输。所以得Signaling Command使用CID 0x0001.
多个Command可以在一个C-frame(control frame)中发送。
如果要直接发送Signaling Command.需要建立SOCK_RAW类型的L2CAP连接Socket。这样才有机会自己填充Command Code,Identi ......
一:前言
最近在研究android的sensor driver,主要是E-compass,其中用到了Linux input子系统.在网上也看了很多这方面的资料,感觉还是这篇分析的比较细致透彻,因此转载一下以便自己学习,同时和大家分享!
(这篇博客主要是以键盘驱动为例的,不过讲解的是Linux Input Subsystem,可以仔细的研究一下!)
键盘驱动将检 ......
Boss说,要看OpenGL,看了快一个月,总算出了个像样的东西,用C写了个3D迷宫,
虽然只有350行
代码,不过边学边写,足足写了一周时间,还是小有成就感的,活活活!
&n ......
Emebedded System and Application(Linux)
Goal
--
掌握嵌入式系统开发的流程,系统移植的方法,编写Bootloader
(Be familiar with the process of ES Developing
, System Migration
amd Bootloader Programming
)
Requriem ......