From 695e307eb3107dc9d511ab27760ba46d6916b347 Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Wed, 4 Dec 2002 08:50:45 +0000 Subject: "" svn path=/trunk/; revision=274 --- externals/grill/flext/source/flthr.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'externals/grill/flext/source/flthr.cpp') diff --git a/externals/grill/flext/source/flthr.cpp b/externals/grill/flext/source/flthr.cpp index 705f1631..2a3ad3df 100644 --- a/externals/grill/flext/source/flthr.cpp +++ b/externals/grill/flext/source/flthr.cpp @@ -54,6 +54,8 @@ bool flext_base::StartThread(void *(*meth)(thr_params *p),thr_params *p,char *me parm.sched_priority = prio-1; pthread_setschedparam(id,policy,&parm); } + +// post("Create thread"); pthread_t thrid; int ret = pthread_create (&thrid,&attr,(void *(*)(void *))meth,p); @@ -66,6 +68,8 @@ bool flext_base::StartThread(void *(*meth)(thr_params *p),thr_params *p,char *me #ifdef _DEBUG error((char *)(ret == EAGAIN?"%s - Unsufficient resources to launch thread!":"%s - Could not launch method!"),methname); #endif + error((char *)("%s - Could not launch method!"),methname); + delete p; return false; } @@ -73,6 +77,8 @@ bool flext_base::StartThread(void *(*meth)(thr_params *p),thr_params *p,char *me #ifdef MAXMSP sched_yield(); #endif +// post("Create thread: OK"); + return true; } } @@ -81,6 +87,8 @@ bool flext_base::PushThread() { tlmutex.Lock(); +// post("Push thread"); + // make an entry into thread list thr_entry *nt = new thr_entry; if(thrtail) thrtail->nxt = nt; @@ -130,6 +138,8 @@ void flext_base::PopThread() { tlmutex.Lock(); +// post("Pop thread"); + pthread_t id = pthread_self(); thr_entry *prv = NULL,*ti; -- cgit v1.2.1