]> git.pond.sub.org Git - empserver/blobdiff - src/lib/empthread/pthread.c
Fix trailing whitespace
[empserver] / src / lib / empthread / pthread.c
index 9681b1abc906ed357e5d5d6059e19c5cd30c19f3..aa8b56949f1d11ca9984b15841fdcbf8274da93e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2007, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
  *  ---
  *
  *  pthread.c: Interface from Empire threads to POSIX threads
- * 
+ *
  *  Known contributors to this file:
  *     Sasha Mikheev
  *     Steve McClure, 1998
 #include <stdlib.h>
 #include <string.h>
 #include <sys/types.h>
-#if !defined(_WIN32)
 #include <sys/time.h>
 #include <unistd.h>
-#endif
 
 #include "misc.h"
 #include "empthread.h"
@@ -180,14 +178,8 @@ empth_init(void **ctx_ptr, int flags)
 }
 
 
-/*
- * prio can be used for setting scheeduling policy but...
- * it seems to be optional in POSIX threads and Solaris
- * for example just ignores it.
- * More then that priority is not needed even in lwp threads.
- */
 empth_t *
-empth_create(int prio, void (*entry)(void *), int size, int flags,
+empth_create(void (*entry)(void *), int size, int flags,
             char *name, void *ud)
 {
     pthread_t t;
@@ -255,6 +247,20 @@ empth_self(void)
     return pthread_getspecific(ctx_key);
 }
 
+char *
+empth_name(empth_t *thread)
+{
+    return thread->name;
+}
+
+void
+empth_set_name(empth_t *thread, char *name)
+{
+    if (thread->name)
+       free(thread->name);
+    thread->name = strdup(name);
+}
+
 void
 empth_exit(void)
 {