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

Reply via email to