Update of /cvsroot/pure-data/externals/grill/vasp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24297/source
Modified Files: buflib.cpp Log Message: ""
Index: buflib.cpp =================================================================== RCS file: /cvsroot/pure-data/externals/grill/vasp/source/buflib.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** buflib.cpp 10 Nov 2003 03:37:03 -0000 1.10 --- buflib.cpp 21 Jun 2004 14:01:12 -0000 1.11 *************** *** 61,65 ****
#ifdef FLEXT_THREADS ! static flext::ThrMutex libmtx; #endif
--- 61,65 ----
#ifdef FLEXT_THREADS ! static flext::ThrMutex libmtx,freemtx; #endif
*************** *** 74,78 **** refcnt(0),nxt(NULL) { ! data = (S *)NewAligned(fr*sizeof(S)); if(zero) flext::ZeroMem(data,len*sizeof(*data)); } --- 74,78 ---- refcnt(0),nxt(NULL) { ! data = (S *)NewAligned(len*sizeof(*data)); if(zero) flext::ZeroMem(data,len*sizeof(*data)); } *************** *** 198,201 **** --- 198,206 ---- static const t_symbol *GetLibSym() { + #ifdef FLEXT_THREADS + freemtx.Lock(); + #endif + const t_symbol *ret; + if(freehead) { // reuse from free-list *************** *** 205,209 **** const t_symbol *s = r->sym; delete r; ! return s; } else { --- 210,214 ---- const t_symbol *s = r->sym; delete r; ! ret = s; } else { *************** *** 215,220 **** STD::sprintf(tmp,"vasp!%04x",libcnt); libcnt++; ! return gensym(tmp); } }
--- 220,230 ---- STD::sprintf(tmp,"vasp!%04x",libcnt); libcnt++; ! ret = gensym(tmp); } + + #ifdef FLEXT_THREADS + freemtx.Unlock(); + #endif + return ret; }
*************** *** 225,232 **** --- 235,250 ---- #endif
+ #ifdef FLEXT_THREADS + freemtx.Lock(); + #endif + FreeEntry *f = new FreeEntry(sym); if(!freehead) freehead = f; else freetail->nxt = f; freetail = f; + + #ifdef FLEXT_THREADS + freemtx.Unlock(); + #endif }