f1nalspace / final_game_tech

Game related libraries written in C/C++ written by T. Spaete
MIT License
175 stars 10 forks source link

[POSIX] Remove the requirement of pthread_yield or make it optional #137

Closed f1nalspace closed 1 year ago

f1nalspace commented 1 year ago

Currently on my latest try to compile FPL demos with Linux (Arch-Linux), I get an error that pthread_yield is not found. This will fully prevent FPL to startup and shows the following errors in the log:

[fplPlatformInit:23206][Debug] [Core] Initialize POSIX Subplatform:
[fpl__PThreadLoadApi:8352][Warning] [pthread] Failed loading library 'libpthread.so'
[fpl__PThreadLoadApi:8364][Warning] [pthread] Failed getting procedure address 'pthread_yield' from library 'libpthread.so.0'
[fpl__PosixInitSubplatform:14543][Error] [POSIX] Failed initializing PThread API

Also why is "Failed loading library 'libpthread.so'" coming before "Failed getting procedure address..."... weird.

As I found out, pthread_yield should not be used or should be at least optional, see: https://stackoverflow.com/a/32183859