Re: Bug in log.c

Stipe Tolj <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Organization Wapme Systems AG
Message-ID <[email protected]>
Alexander Malysh wrote:
> 
> oops, that was wrong :(
> 
> here is the possible solution:
> static void delete_threadinfo(void)
> {
>     struct threadinfo *threadinfo;
> 
>     threadinfo = getthreadinfo();
>     list_destroy(threadinfo->joiners, NULL);
>     close(threadinfo->wakefd_recv);
>     close(threadinfo->wakefd_send);
>     THREAD(threadinfo->number) = NULL;
>     active_threads--;
>     if (threadinfo->number < next_threadnumber)
>         next_threadnumber = threadinfo->number;
>     gw_assert(threadinfo != &mainthread);
>     gw_free(threadinfo);
> }
> 
> next_threadnumber is always the min. free slot number.
> worst case while creating new thread:
>         next_threadnumber is used then max MAX_THREATABLE_SIZE-next_threadnumber
> loop.

to be honest I'm a bit concerned in too drastically change things
inside our thread handling.

I'll rather pick the easier and secure way here.

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.