Linux下C++类的线程函数
最近在用C++编写一个RTSP的客户端,由于要用到线程,根据C编程的经验,写了如下代码:
class LiRtspSession
{
public:
void* MainThreadFunc(void* pvData);
void* AudioProcThreadFunc(void* pvData);
void Connect();
//省略的代码
private:
pthread_t m_hProcHandle, m_hAudioProcHandle;
//省略的代码
};
void LiRtspSession::Connect()
{
//create main thread creating rtsp session and receiving rtp/rtcp packet
int ret = pthread_create(&m_hProcHandle, NULL, MainThreadFunc, this);
if(ret != 0)
{
return;
}
//create a thread receiving audio data
if(m_bAudioEnabled && m_eProtoType == ptUDP);
{
ret = pthread_create(&m_hAudioProcHandle, NULL, AudioProcThreadFunc, this);
if(ret != 0)
{
return;
}
}
pthread_join(m_hProcHandle, NULL);
if(m_bAudioEnabled && m_eProtoType == ptUDP);
{
pthread_join(m_hAudioProcHandle, NULL);
}
}
但是在编译时却出现如下错误:
LiRtspSession.cpp: In member function ‘void LiRtspSession::Connect()’:
LiRtspSession.cpp:176: error: argume
相关文档:
1. HCI层协议概述:
HCI提供一套统一的方法来访问Bluetooth底层。如图所示:
从图上可以看出,Host Controller Interface(HCI) 就是用来沟通Host和Module。Host通常就是PC, Module则是以各种物理连接形式(USB,serial,pc-card等)连接到PC上的bluetooth Dongle。
在Host这一端:application,SDP,L2cap等协议 ......
一:前言
最近在研究android的sensor driver,主要是E-compass,其中用到了Linux input子系统.在网上也看了很多这方面的资料,感觉还是这篇分析的比较细致透彻,因此转载一下以便自己学习,同时和大家分享!
(这篇博客主要是以键盘驱动为例的,不过讲解的是Linux Input Subsystem,可以仔细的研究一下!)
键盘驱动将检 ......
1.谈到linux的文件系统,我们必须关注/etc/fstab文件的内容;在linux中的所有挂载分区和设备都在fstab表格中。
/etc/fstab表格中的选择项参数定义如下:
ro or rw
Read only or read write
noauto
Do not respond to mount -a. Used for external devices CDROMs ...
noexec
Executables cannot be started from the ......
当内存出现不够用的时候,oom-killer会kill掉一些进程
这个信息可以在/var/log/messger里查到
当这种情况出现的时候,可以将系统里一些nattach为0的shm清理掉
关于高低端内存的问题可以看如下
Since this problem seems to popup on different lists, this message has
been cross-posted to the general Red Hat disc ......
linux添加路由
http://baikgd.blog.163.com/blog/static/35402495200972111353827/
服务器ip(eth0)
[root@localhost net]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:E3:9A:15
inet addr:172.18.3.205 Bcast:172.18.3.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fee3:9a15/64 Scope:Link
UP BR ......