PJLIB thread/pools

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am getting a 120012 from pj_thread_create  after about 380 threads, most
of them have been terminated when I get the error.

To create the thread:

pj_thread_t *thread=NULL;
pj_pool_t *threadPool=NULL;

pj_status_t SocketHandler::startThread(pj_pool_factory *pf,int index) {
    pj_status_t status;
    char name[1024];

    sprintf(name,"Client:%08x",index);

    // create pool
    threadPool=pj_pool_create(pf, name, PJ_THREAD_DEFAULT_STACK_SIZE,
PJ_THREAD_DEFAULT_STACK_SIZE, NULL);
    if (threadPool==NULL) {
        PJ_LOG(3,(__FILE__,"Unable to create memory pool"));
        return 1;
    }
    // create thread

status=pj_thread_create(threadPool,name,threadProc,this,PJ_THREAD_DEFAULT_S
TACK_SIZE,0,&thread);
    if (status!=0) {
        PJ_LOG(3,(__FILE__,"pj_thread_create returned %d",status)); //
this is where the error is logged
    }
    return status;
}


When destroying the threads:
  pj_status_t status;

   status=pj_thread_destroy(thread);
    if (status!=0) {
        PJ_LOG(3,(__FILE__,"pj_thread_destroy returned %d",status));
    }
    pj_pool_release(threadPool);


The errno is not in the PJ range given the header file, however, 12 is
ENOMEM, so I presume it is some sort of memory issue.   This is using the
2.0 release of pjproject.   Am I doing something wrong?


Notice: The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system.



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux