Re: Bug in log.c

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Wapme Systems AG
Message-ID <[email protected]>

Michael Mulcahy schrieb:
> 
> Hi All,
> 
> Found a solution that I think should be ok.
> 
> In the gwthread-module the table is size 1024.
> While the thread number may increase byond it the
> id is a modulo of 1024 and so the modulo can be
> used in the log.c to prevent the prior mentioned
> problem.
> 
> suggested fix would be to use following:
> 
>         if ((e = thread_to[(gwthread_self()%1024)])) {
> 
> Have tested this and appears to work.

how about having this inside gwthread-pthread.c as function:

/* Return the threadtable sloot this thread is using. */
long gwthread_table_slot(void)
{
    return (gwthread_self() % THREADTABLE_SIZE);
}

and use this call instead of gwthread_self() for the logging
functions?!

Stipe

[email protected]
-------------------------------------------------------------------
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [email protected]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.