private.h

来自「贡献一份commoncpp2,有兴趣的可以研究一下」· C头文件 代码 · 共 89 行

H
89
字号
#ifndef	CCXX_PRIVATE_H_#define	CCXX_PRIVATE_H_#ifdef CCXX_NAMESPACESnamespace ost {#endifclass ThreadImpl{friend class Thread;friend class DummyThread;friend class PosixThread;friend class Slog;	ThreadImpl(int type):		_msgpos(0),		_throw(Thread::throwObject),		_tid(0),		_suspendEnable(true),		_type(type),#ifndef WIN32		_jtid(0)#else		_detached(false),		_active(false),		_hThread(NULL),		_cancellation(NULL)#endif	{ ; };	// derived class copy constructor creates new instance, so base	// copy constructor of ThreadImpl should do nothing...	ThreadImpl(const ThreadImpl& copy)		{;};	ThreadImpl &operator=(const ThreadImpl& copy)		{return *this;};#ifdef	_THR_MACH	mach_port_t	_mach;#endif#ifndef WIN32	pthread_attr_t _attr;	AtomicCounter _suspendcount;	static ThreadKey _self;#else	size_t _stack;	int _priority;	HANDLE _cancellation;#endif	// log information	size_t _msgpos;	char _msgbuf[128];	Thread::Throw _throw;	cctid_t _tid;#ifndef WIN32	friend Thread *getThread(void);	volatile bool _suspendEnable:1;	unsigned int _type:3;	cctid_t _jtid;#else	bool _detached:1;	bool _active:1;	bool _suspendEnable:1;	unsigned int _type:3;	static unsigned __stdcall Execute(Thread *th);	HANDLE	_hThread;#endifpublic:	// C binding functions	static inline void ThreadExecHandler(Thread* th);#ifndef WIN32	static inline RETSIGTYPE ThreadSigSuspend(int);	static inline void ThreadCleanup(Thread* arg);	static inline void ThreadDestructor(Thread* arg);	static inline void PosixThreadSigHandler(int signo);#endif};#ifdef CCXX_NAMESPACES}#endif#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?