On 01/12/2018 03:36 AM, Liu Hao wrote:
> On 2018/1/12 4:31, Jacek Caban wrote:
>> Signed-off-by: Jacek Caban <ja...@codeweavers.com>
>> ---
>>  mingw-w64-crt/Makefile.am         |  1 +
>>  mingw-w64-crt/misc/onexit_table.c | 74
>> +++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 75 insertions(+)
>>  create mode 100644 mingw-w64-crt/misc/onexit_table.c
>>
>>
>>
> There are 3 issues here:
>
> 0. The function `__dllonexit()` is declared but unused.

Yes, it's a leftover from my initial implementation based on old
atonexit.c. It's fixed in the version I committed.

> 1. `while (--last >= first)` when the loop breaks out, `last` is
>    decremented before `first` thus out of defined range, which is
>    probably bad.

We never dereference it after the final decrement, so I don't see what's
wrong with it.

> 2. Are there any reasons why `_register_onexit_function()` involves
>    the global lock but `_execute_onexit_table` does not?

Yeah, it was inspired by previous code in crtdll.c, which didn't lock,
but it should probably be fixed. I will look at it.

Thanks for review.

Cheers,
Jacek

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to