diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-07-19 11:35:11 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-07-19 11:35:11 -0300 |
| commit | d359c0af4874534efa810729d47f610a29687e93 (patch) | |
| tree | 9a89b06444819e7e5cef84aa826682b3b01bfd03 /src/common.hh | |
| parent | 638244fd078fe91971e57b1d06e4499268d99c42 (diff) | |
| download | game-d359c0af4874534efa810729d47f610a29687e93.tar.gz game-d359c0af4874534efa810729d47f610a29687e93.zip | |
THREADING: upgrade from LinuxThreads to NPTL
This was a required change to make the server run on a modern
GLIBC version without resorting to shady shared libraries or
compatibility tricks. It is very straightforward but we should
always keep an eye out for possible bugs.
There was also a problem with the Z loop on field sending
functions that was causing the server to hang in an infinite
loop and should now be fixed.
With these changes it is now possible to login into the game
for a split second before the client asserting.
Diffstat (limited to 'src/common.hh')
| -rw-r--r-- | src/common.hh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/common.hh b/src/common.hh index b97de3c..971dca2 100644 --- a/src/common.hh +++ b/src/common.hh @@ -78,12 +78,16 @@ typedef size_t usize; // Nevertheless, we should focus on getting it working as intended, on the target // platform (which is Linux 32-bit) before attempting to refine it. STATIC_ASSERT(OS_LINUX); -STATIC_ASSERT(sizeof(bool) == 1); -STATIC_ASSERT(sizeof(int) == 4); -//STATIC_ASSERT(sizeof(void*) == 4); #include <errno.h> #include <unistd.h> +// NOTE(fusion): This is the member name for the thread id in `struct sigevent` +// when `sigev_notify` is `SIGEV_THREAD_ID` but for whatever reason glibc doesn't +// define it. +#ifndef sigev_notify_thread_id +# define sigev_notify_thread_id _sigev_un._tid +#endif + // shm.cc // ============================================================================= void StartGame(void); @@ -93,7 +97,8 @@ bool LoginAllowed(void); bool GameRunning(void); bool GameStarting(void); bool GameEnding(void); -pid_t GetGameThreadPID(void); +pid_t GetGameProcessID(void); +pid_t GetGameThreadID(void); int GetPrintlogPosition(void); char *GetPrintlogLine(int Line); void IncrementObjectCounter(void); |
