Re: [AD] 4.9/src/win/wxthread.c |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2009-03-14, AJ <aj@xxxxxxxxxx> wrote:
> i see threading issues...
>
> _beginThread() 's return value can be wrong for short lived threads
Thanks for pointing it out.
> the return value is stored in the thread->thread member
> the trampoline should call thread->thread = GetCurrentThread(); to
> ensure it gets a valid handle, as the handle _has_to exist at the time
> of the GetCurrentThread() call.
That introduces another (probably more likely) problem.
_al_thread_create() returns, then it's quite possible that the user then
calls another function which accesses `thread->thread' *before*
thread_proc_trampoline() has filled it in. So more synchronisation is
needed.
Anyone willing to fix this? Otherwise into the bug tracker it goes...
Peter