[ros-kernel] mmTaskCreate patch - For you sound junkys
Eric Pouech
pouech-eric at wanadoo.fr
Wed Jul 14 22:46:38 CEST 2004
Filip Navara a écrit :
> Eric Pouech wrote:
>
>> Filip Navara a écrit :
>>
>>> Here is more correct version of that patch. It's against the ReactOS
>>> CVS. I can produce one against Wine CVS on request.
>>
>>
>> why do you need an event ? a thread object is waitable, and signaled
>> when the thread terminates, which is exactly what your event does.
>
>
> Ok, maybe it's not the best way, but it's the way Windows does it. Your
> version has two problems:
> - mm_starter is stored on stack and can be destroyed before it reaches
> mmTaskRun. It's very unlikely that this will happen, but it's possible.
I already fixed that (just after sending the patch to Steven)
> - You leak a thread handle when ph == NULL.
> Currently I can't see any way how the caller can depend on the handle
> being an event, so after all it may be a bit redundant...
maybe for the mmTaskBlock and mmTaskSignal
>
>> Moreover, you leak the event when the thread terminates.
> The caller is responsible for closing the event handle.
but you still leak it if you don't succeed in creating the thread
A+
More information about the Ros-kernel
mailing list