[PD-cvs] externals/grill/flext/source fldefs_meththr.h, 1.3, 1.4 flsupport.h, 1.90, 1.91 flthr.cpp, 1.30, 1.31

Thomas Grill xovo at users.sourceforge.net
Tue Jun 7 16:40:21 CEST 2005


Update of /cvsroot/pure-data/externals/grill/flext/source
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7886/source

Modified Files:
	fldefs_meththr.h flsupport.h flthr.cpp 
Log Message:
cosmetic stuff
corrections to config build templates
digest one-element list messages as single atoms
made flext::Forward threadsafe
simplified message analysis


Index: fldefs_meththr.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/fldefs_meththr.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** fldefs_meththr.h	26 Jan 2005 05:01:45 -0000	1.3
--- fldefs_meththr.h	7 Jun 2005 14:40:18 -0000	1.4
***************
*** 50,54 ****
  	thisType *th = FLEXT_CAST<thisType *>(p->cl); \
  	bool ok = th->PushThread(); \
! 	AtomAnything *args = p->var[0]._any.args; \
  	delete p; \
  	if(ok) { \
--- 50,54 ----
  	thisType *th = FLEXT_CAST<thisType *>(p->cl); \
  	bool ok = th->PushThread(); \
! 	AtomAnything *args = p->var[0]._any; \
  	delete p; \
  	if(ok) { \
***************
*** 68,72 ****
  	thisType *th = FLEXT_CAST<thisType *>(p->cl); \
  	bool ok = th->PushThread(); \
! 	AtomList *args = p->var[0]._list.args; \
  	delete p; \
  	if(ok) { \
--- 68,72 ----
  	thisType *th = FLEXT_CAST<thisType *>(p->cl); \
  	bool ok = th->PushThread(); \
! 	AtomList *args = p->var[0]._list; \
  	delete p; \
  	if(ok) { \
***************
*** 82,86 ****
  #define FLEXT_THREAD_X(M_FUN) \
  static bool FLEXT_CALL_PRE(M_FUN)(flext_base *c,void *data) {  \
! 	thr_params *p = new thr_params; p->var[0]._ext.data = data; \
  	return c->StartThread(FLEXT_THR_PRE(M_FUN),p,#M_FUN); \
  } \
--- 82,86 ----
  #define FLEXT_THREAD_X(M_FUN) \
  static bool FLEXT_CALL_PRE(M_FUN)(flext_base *c,void *data) {  \
! 	thr_params *p = new thr_params; p->var[0]._ext = data; \
  	return c->StartThread(FLEXT_THR_PRE(M_FUN),p,#M_FUN); \
  } \
***************
*** 88,92 ****
  	thisType *th = FLEXT_CAST<thisType *>(p->cl); \
  	bool ok = th->PushThread(); \
! 	void *data = p->var[0]._ext.data; \
  	delete p; \
  	if(ok) { \
--- 88,92 ----
  	thisType *th = FLEXT_CAST<thisType *>(p->cl); \
  	bool ok = th->PushThread(); \
! 	void *data = p->var[0]._ext; \
  	delete p; \
  	if(ok) { \

Index: flthr.cpp
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flthr.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** flthr.cpp	7 Jun 2005 14:13:49 -0000	1.30
--- flthr.cpp	7 Jun 2005 14:40:19 -0000	1.31
***************
*** 105,111 ****
  
  
- flext::thrid_t flext::GetSysThreadId() { return thrid; }
- 
- 
  static void LaunchHelper(thr_entry *e)
  {
--- 105,108 ----
***************
*** 602,607 ****
  flext_base::thr_params::~thr_params() { if(var) delete[] var; }
  
! void flext_base::thr_params::set_any(const t_symbol *s,int argc,const t_atom *argv) { var[0]._any.args = new AtomAnything(s,argc,argv); }
! void flext_base::thr_params::set_list(int argc,const t_atom *argv) { var[0]._list.args = new AtomList(argc,argv); }
  
  
--- 599,604 ----
  flext_base::thr_params::~thr_params() { if(var) delete[] var; }
  
! void flext_base::thr_params::set_any(const t_symbol *s,int argc,const t_atom *argv) { var[0]._any = new AtomAnything(s,argc,argv); }
! void flext_base::thr_params::set_list(int argc,const t_atom *argv) { var[0]._list = new AtomList(argc,argv); }
  
  

Index: flsupport.h
===================================================================
RCS file: /cvsroot/pure-data/externals/grill/flext/source/flsupport.h,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -d -r1.90 -r1.91
*** flsupport.h	7 Jun 2005 14:13:49 -0000	1.90
--- flsupport.h	7 Jun 2005 14:40:18 -0000	1.91
***************
*** 782,790 ****
  //!		@} FLEXT_S_LOCK
  
- #ifdef FLEXT_THREADS
  	/*!	\defgroup FLEXT_S_THREAD Flext thread handling 
  		@{ 
  	*/
  
  	//! thread type
  #if FLEXT_THREADS == FLEXT_THR_MP
--- 782,800 ----
  //!		@} FLEXT_S_LOCK
  
  	/*!	\defgroup FLEXT_S_THREAD Flext thread handling 
  		@{ 
  	*/
  
+     //! Check if current thread is the realtime system's thread
+ 	static bool IsSystemThread() { 
+ #ifdef FLEXT_THREADS
+         return IsThread(GetSysThreadId()); 
+ #else
+         return true;
+ #endif
+     }
+ 
+ #ifdef FLEXT_THREADS
+ 
  	//! thread type
  #if FLEXT_THREADS == FLEXT_THR_MP
***************
*** 814,818 ****
  	/*! \brief Get system thread id
  	*/
! 	static thrid_t GetSysThreadId();
  
  	//! Check if current thread should terminate
--- 824,828 ----
  	/*! \brief Get system thread id
  	*/
!     static thrid_t GetSysThreadId() { return thrid; }
  
  	//! Check if current thread should terminate
***************
*** 830,836 ****
  	}
  
- 	//! Check if current thread is the realtime system's thread
- 	static bool IsSystemThread() { return IsThread(GetSysThreadId()); }
- 
  
  	/*! \brief Thread parameters
--- 840,843 ----
***************
*** 853,859 ****
  			int _int;
  			t_symptr _t_symptr;
! 			struct { AtomAnything *args; } _any;
! 			struct { AtomList *args; } _list;
! 			struct { void *data; } _ext;
  		} *var;
  	};
--- 860,866 ----
  			int _int;
  			t_symptr _t_symptr;
! 			AtomAnything *_any;
! 			AtomList *_list;
! 			void *_ext;
  		} *var;
  	};
***************
*** 1094,1102 ****
  	static bool StopThread(void (*meth)(thr_params *p),thr_params *params = NULL,bool wait = false);
  
- //!		@} FLEXT_S_THREAD
- 
- 
  #endif // FLEXT_THREADS
  
  
  // --- timer stuff -----------------------------------------------
--- 1101,1108 ----
  	static bool StopThread(void (*meth)(thr_params *p),thr_params *params = NULL,bool wait = false);
  
  #endif // FLEXT_THREADS
  
+ //!		@} FLEXT_S_THREAD
+ 
  
  // --- timer stuff -----------------------------------------------





More information about the Pd-cvs mailing list