static TA_context* tactx_Alloc(void) { TA_context* rv = 0; #ifndef TARGET_NO_THREADS slock_lock(mtx_pool); #endif if (ctx_pool.size()) { rv = ctx_pool[ctx_pool.size()-1]; ctx_pool.pop_back(); } #ifndef TARGET_NO_THREADS slock_unlock(mtx_pool); #endif if (rv) return rv; rv = new TA_context(); rv->Alloc(); printf("new tactx\n"); return rv; }
TA_context* tactx_Alloc() { TA_context* rv = 0; mtx_pool.Lock(); if (ctx_pool.size()) { rv = ctx_pool[ctx_pool.size()-1]; ctx_pool.pop_back(); } mtx_pool.Unlock(); if (!rv) { rv = new TA_context(); rv->Alloc(); printf("new tactx\n"); } return rv; }