apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oscar Pernas <os...@pernas.es>
Subject creating threads
Date Wed, 08 Sep 2010 09:56:03 GMT
Hi all,

Im using apr to throw new threads for making callbacks. My problem is that
when I have made exactly 632 calls to the function throwOnMessage, the
thread onMessage is not throwed by it anymore, the thread is not created
(I've put traces into the first instruction and it is not executed). This
code shuld work?

// thread that sends message to user
static void* APR_THREAD_FUNC onMessage(apr_thread_t *thd, void *data){

ActiveCallbackData* activeCallbackData=NULL;
 if (data){
if (activeCallbackData){

//deleting thread from the map

//deleting object
 delete activeCallbackData;
//deleting thread
apr_thread_exit(thd, APR_SUCCESS);
return NULL;

void ActiveCallback::throwOnMessage(ActiveMessage& activeMessageR){

//creating object that will be stored by the thread
 ActiveCallbackData* activeCallbackData=new
//vars for threads
 apr_thread_t *thd_arr;
//thread atts
apr_threadattr_t *thd_attr;
 //creating thread attributes
apr_threadattr_create(&thd_attr, mp);
//creating the thread
 apr_thread_create(&thd_arr, thd_attr, onMessage, (void*)activeCallbackData,

Óscar Pernas Plaza.

Óscar Pernas Plaza.

View raw message