11 #if defined(THREAD_SAFE)
18 #if defined(THREAD_SAFE)
19 extern pthread_mutex_t mutex_dfpool;
20 extern pthread_key_t admb_pthread_key;
31 #if defined(USE_VECTOR_SHAPE_POOL)
39 void ts_vector_shapex::shift(
int min)
41 index_max=index_max-index_min+
min;
45 const int max_number_threads=10;
51 int get_pthread_number(
void)
53 int* p_keyval = (
int*)pthread_getspecific(admb_pthread_key);
66 #if defined(USE_VECTOR_SHAPE_POOL)
72 void * ts_vector_shapex::operator
new(
size_t n)
76 pthread_mutex_lock(&mutex_dfpool);
79 xpool =
new pts_vector_shape_pool[max_number_threads];
80 for (
int i=0;i<max_number_threads;i++)
84 pthread_mutex_unlock(&mutex_dfpool);
88 int pnum=get_pthread_number();
93 # if defined(SAFE_ALL)
94 if (n != xpool[pnum]->size)
96 cerr <<
"incorrect size requested in dfpool" <<
endl;
100 return xpool[pnum]->alloc();
107 void ts_vector_shapex::operator
delete(
void * ptr,
size_t n)
109 xpool[get_pthread_number()]->free(ptr);
111 #endif // defined(THREAD_SAFE)
112 #endif // defined(THREAD_SAFE)
prnstream & endl(prnstream &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
Description not yet available.
Description not yet available.