/*
* 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
* ---
*
* 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"
}
-/*
- * 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;
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)
{