From c4679700d4a75a1f8274880e075d6441f6f0b287 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Mon, 23 Aug 2004 02:33:18 +0000 Subject: "" svn path=/trunk/; revision=1969 --- externals/grill/flext/changes.txt | 2 ++ externals/grill/flext/source/fllib.cpp | 4 +-- externals/grill/flext/source/flsupport.cpp | 40 ------------------------------ externals/grill/flext/source/flsupport.h | 36 +-------------------------- externals/grill/flext/source/flthr.cpp | 7 +++++- 5 files changed, 11 insertions(+), 78 deletions(-) (limited to 'externals') diff --git a/externals/grill/flext/changes.txt b/externals/grill/flext/changes.txt index 2a08cc43..f00dc4d5 100644 --- a/externals/grill/flext/changes.txt +++ b/externals/grill/flext/changes.txt @@ -20,6 +20,8 @@ Version history: - support exceptions for setup functions, object creation and destruction, method handling - small fixes for MSVC6 incompatibilites - fixes for Max 4.5 headers +- removed Mach-O/CFM glue stuff again....Max has gone Mach-O in the meantime... +- in flext::StopThread don't wait for thread to have stopped! 0.4.6: - added a text edit window for list attributes diff --git a/externals/grill/flext/source/fllib.cpp b/externals/grill/flext/source/fllib.cpp index ce4e5703..80e95729 100755 --- a/externals/grill/flext/source/fllib.cpp +++ b/externals/grill/flext/source/fllib.cpp @@ -175,10 +175,10 @@ void flext_obj::lib_init(const char *name,void setupfun(),bool attr) setupfun(); } catch(std::exception &x) { - error("%s - Exception at library setup: %s",name,x.what()); + error("%s - %s",name,x.what()); } catch(char *txt) { - error("%s - Exception at library setup: %s",name,txt); + error("%s - %s",name,txt); } catch(...) { error("%s - Unknown exception at library setup",name); diff --git a/externals/grill/flext/source/flsupport.cpp b/externals/grill/flext/source/flsupport.cpp index 8aa12fb0..85d9720d 100644 --- a/externals/grill/flext/source/flsupport.cpp +++ b/externals/grill/flext/source/flsupport.cpp @@ -80,46 +80,6 @@ void flext::Setup() #endif #ifdef FLEXT_THREADS - -#if FLEXT_SYS == FLEXT_SYS_MAX && FLEXT_OS == FLEXT_OS_MAC && FLEXT_THREADS == FLEXT_THR_POSIX - // for Max OSX/CFM MachO functions have to be imported - CFBundleRef bundle = NULL; - if (bundle = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.Carbon"))) - { - //load pthread function pointers - pthread_self = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_self")); - pthread_equal = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_equal")); - pthread_create = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_create")); - pthread_cancel = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_cancel")); - pthread_testcancel = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_testcancel")); - pthread_join = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_join")); - pthread_exit = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_exit")); - - pthread_attr_init = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_attr_init")); - pthread_attr_destroy = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_attr_destroy")); - pthread_attr_setdetachstate = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_attr_setdetachstate")); - - pthread_attr_getschedparam = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_attr_getschedparam")); - pthread_attr_setschedparam = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_attr_setschedparam")); - - pthread_mutex_init = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_mutex_init")); - pthread_mutex_destroy = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_mutex_destroy")); - pthread_mutex_lock = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_mutex_lock")); - pthread_mutex_unlock = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_mutex_unlock")); - pthread_mutex_trylock = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_mutex_trylock")); - - pthread_cond_init = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_cond_init")); - pthread_cond_destroy = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_cond_destroy")); - pthread_cond_signal = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_cond_signal")); - pthread_cond_wait = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_cond_wait")); - pthread_cond_timedwait = CFBundleGetFunctionPointerForName(bundle, CFSTR("pthread_cond_timedwait")); - - sched_yield = CFBundleGetFunctionPointerForName(bundle, CFSTR("sched_yield")); - sched_get_priority_min = CFBundleGetFunctionPointerForName(bundle, CFSTR("sched_get_priority_min")); - sched_get_priority_max = CFBundleGetFunctionPointerForName(bundle, CFSTR("sched_get_priority_max")); - } -#endif - thrid = GetThreadId(); StartHelper(); #endif diff --git a/externals/grill/flext/source/flsupport.h b/externals/grill/flext/source/flsupport.h index 14ddad47..d9f5b540 100644 --- a/externals/grill/flext/source/flsupport.h +++ b/externals/grill/flext/source/flsupport.h @@ -647,41 +647,6 @@ public: @{ */ -#if FLEXT_SYS == FLEXT_SYS_MAX && FLEXT_OS == FLEXT_OS_MAC && FLEXT_THREADS == FLEXT_THR_POSIX - // These are function pointers of MachO functions imported to the CFM world - - static pthread_t (*pthread_self)(); - static int (*pthread_equal)(pthread_t,pthread_t); - static int (*pthread_create)(pthread_t *,const pthread_attr_t *,void *(*)(void *),void *); - static int (*pthread_cancel)(pthread_t); - static void (*pthread_testcancel)(void); - static int (*pthread_join)(pthread_t,void **); - static void (*pthread_exit)(void *); - - static int (*pthread_attr_init)(pthread_attr_t *); - static int (*pthread_attr_destroy)(pthread_attr_t *); - static int (*pthread_attr_setdetachstate)(pthread_attr_t *,int); - - static int (*pthread_getschedparam)(pthread_t,int *,struct sched_param *); - static int (*pthread_setschedparam)(pthread_t,int,const struct sched_param *); - - static int (*pthread_mutex_init)(pthread_mutex_t *,const pthread_mutexattr_t *); - static int (*pthread_mutex_destroy)(pthread_mutex_t *); - static int (*pthread_mutex_lock)(pthread_mutex_t *); - static int (*pthread_mutex_unlock)(pthread_mutex_t *); - static int (*pthread_mutex_trylock)(pthread_mutex_t *); - - static int (*pthread_cond_init)(pthread_cond_t *,const pthread_condattr_t *); - static int (*pthread_cond_destroy)(pthread_cond_t *); - static int (*pthread_cond_signal)(pthread_cond_t *); - static int (*pthread_cond_wait)(pthread_cond_t *,pthread_mutex_t *); - static int (*pthread_cond_timedwait)(pthread_cond_t *,pthread_mutex_t *,const struct timespec *); - - static int (*sched_yield)(void); - static int (*sched_get_priority_min)(int); - static int (*sched_get_priority_max)(int); -#endif - //! thread type #if FLEXT_THREADS == FLEXT_THR_MP typedef MPTaskID thrid_t; @@ -1010,6 +975,7 @@ public: \param params Parameters to pass to the thread, may be NULL if not needed. \return True if at least one matching thread has been found. \remark Terminates all running threads with matching meth and params. + \note Function doesn NOT wait for termination */ static bool StopThread(void (*meth)(thr_params *p),thr_params *params = NULL,bool wait = false); diff --git a/externals/grill/flext/source/flthr.cpp b/externals/grill/flext/source/flthr.cpp index f16ba76d..d6bc9276 100644 --- a/externals/grill/flext/source/flthr.cpp +++ b/externals/grill/flext/source/flthr.cpp @@ -278,7 +278,10 @@ bool flext::StopThread(void (*meth)(thr_params *p),thr_params *p,bool wait) if(found) { // signal thread helper thrhelpcond->Signal(); - +#if 0 + // ###################### + // i don't think we need to wait for a single thread to stop + // ###################### int cnt = 0; for(int wi = 0; wi < 100; ++wi) { // lock and count this object's threads @@ -296,6 +299,8 @@ bool flext::StopThread(void (*meth)(thr_params *p),thr_params *p,bool wait) } return cnt == 0; +#endif + return true; } else return false; -- cgit v1.2.1