[ros-kernel] mmTaskCreate patch - For you sound junkys
Filip Navara
xnavara at volny.cz
Wed Jul 14 20:39:31 CEST 2004
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.
- 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...
> Moreover, you leak the event when the thread terminates.
The caller is responsible for closing the event handle.
Regards,
Filip
More information about the Ros-kernel
mailing list