[AGENT++] Thread handle leak (SNMP++ 3.2.21a)

Stoyan Haralampiev tony at gyuvetch.bg
Mon Jan 22 19:10:13 CET 2007



Hi,


>-------- Оригинално писмо --------
>От: Jochen Katz  
>Относно: Re: [AGENT++] Thread handle leak (SNMP++ 3.2.21a)
>До: agentpp at agentpp.org
>Изпратено на: Неделя, 2007, Януари 21 23:20:39 GMT+02:00
>----------------------------------
>
>Hi,
>
>> It turned out that the same piece of code causes a memory leak under
>> Linux too. The reason is that taskDelete() is not called (in
>> stop_poll_thread()) for the thread created by taskSpawn() (in
>> start_poll_thread()).
>> 
>> Here's some info on taskSpawn/Delete -
>> http://www.slac.stanford.edu/exp/glast/flight/docs/VxWorks/docs/vxworks/ref/taskLib.html#taskDelete
>
>within stop_poll_thread() m_bThreadRunning flag is set to false, and the
>poll thread will stop itself. Is it then legal and a "must do" to call
>taskDelete() for the already finished thread? The taskSpawn() doc does
>not state that taskDelete() has to be called in any case.

It turned out you don't have to call taskDelete() when the thread has already finished because exit() is automatically called when it leaves its main routine.

See the section "TASK DELETION" of the link I've supplied above
for details.

Sorry for the false alarm. 

>
>Regards,
> Jochen
>
>
>_______________________________________________
>AGENTPP mailing list
>AGENTPP at agentpp.org
>http://lists.agentpp.org/mailman/listinfo/agentpp
>

Best regards,
Tony 

-----------------------------------------------------------------
Заложете на късмета си със Спортингбет!


More information about the AGENTPP mailing list