]> git.pond.sub.org Git - empserver/blobdiff - src/lib/empthread/pthread.c
Fix build for systems that don't provide POSIX.1-2001 by default
[empserver] / src / lib / empthread / pthread.c
index ed0f0e4344760493847a75be0c9abf8bdd769ad4..3e02132d46875ab41cb2b35c1b509cb6f42bdedd 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2020, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -33,9 +33,6 @@
  *     Ron Koenderink, 2007-2009
  */
 
-/* Required for PTHREAD_STACK_MIN on some systems, e.g. Solaris: */
-#define _XOPEN_SOURCE 500
-
 #include <config.h>
 
 #include <errno.h>
@@ -58,7 +55,7 @@ struct empth_t {
     void *ud;                  /* user data */
     int wakeup;
     void (*ep)(void *);                /* entry point */
-    pthread_t id;              /* thread id */
+    pthread_t id;              /* thread ID */
 };
 
 struct empth_rwlock_t {
@@ -172,7 +169,6 @@ empth_init(void **ctx_ptr, int flags)
     ctx->wakeup = 0;
     pthread_setspecific(ctx_key, ctx);
     pthread_mutex_lock(&mtx_ctxsw);
-    logerror("pthreads initialized");
     return 0;
 }
 
@@ -215,7 +211,7 @@ empth_create(void (*entry)(void *), int size, int flags,
        logerror("can not create thread: %s: %s", name, strerror(eno));
        goto bad;
     }
-    empth_status("new thread id is %ld", (long)t);
+    empth_status("new thread ID is %ld", (long)t);
     empth_yield();
     return ctx;