Closed migthymax closed 7 months ago
Did you try to compile some pthreads tests that use the functions that use those structs?
@afxgroup No (no time yet), but as long my google search are right these structure should be implementation dependent, so no one using pthread can assume who the structures are build up.
Yes, i know, but all implementation are using pointers as implementation and they are opaque. So internally you can make all changes you want in the internal structures without changing the public header and the pointer size. Not only sometimes i've noticed that compilers needs the struct definition otherwise you will incurr in errors. That's why it is better to test it deeply along some c and c++ tests
Do you have a good test case? Here for re google search https://github.com/openbsd/src/blob/master/include/pthread.h from bsd makes the same concept, defining the structs opaque, same for the https://github.com/openbsd/src/blob/master/include/semaphore.h.
The only one which seems not to be opaque is the pthread_barrier, but I'm unsure.
Probably this will give the best test case for the implementation https://www.opengroup.org/testing/testsuites/vsthover.htm have to dig into it.
I'll commit it. Please test it so we can sure that everything is working correctly
check https://github.com/AmigaLabs/clib4/issues/165#issuecomment-2010211204
I think the only way to fix this problem correctly is to use pointers like in newlib and use an internal struct to take care of everything
Removed SDK includes from public header files:
pthread.h
malloc.h
Restructure implementation, to include none public structures, includes, etc