/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2005, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure
*
* This program is free software; you can redistribute it and/or modify
*
* ---
*
- * See the "LEGAL", "LICENSE", "CREDITS" and "README" files for all the
- * related information and legal notices. It is expected that any future
- * projects/authors will amend these files as needed.
+ * See files README, COPYING and CREDITS in the root of the source
+ * tree for related information and legal notices. It is expected
+ * that future projects/authors will amend these files as needed.
*
* ---
*
* Sasha Mikheev
* Doug Hay, 1998
* Steve McClure, 1998
+ * Markus Armbruster, 2005
*/
/*
* event to happen.
*/
-#ifndef _EMTHREAD_H_
-#define _EMTHREAD_H_
+#ifndef EMPTHREAD_H
+#define EMPTHREAD_H
/* thread priorities */
enum {
* UD is the value to pass to ENTRY. It is also assigned to the
* context variable defined with empth_init() whenever the thread gets
* scheduled.
+ * Yield the processor.
* Return the thread, or NULL on error.
*/
empth_t *empth_create(int prio, void (*entry)(void *),
/*
* Terminate the current thread.
+ * The current thread should not be the thread that executed main().
+ * If it is, implementations may terminate the process rather than the
+ * thread.
* Never returns.
*/
void empth_exit(void);
*/
void empth_sleep(time_t until);
+/*
+ * Wait for some implementation-defined external shutdown signal.
+ * Return a non-negative number identifying the signal.
+ */
+int empth_wait_for_shutdown(void);
+
/*
* Create a semaphore.
* NAME is its name, it is used for debugging.
*/
void empth_sem_wait(empth_sem_t *sem);
+
+/*
+ * Stuff for implementations, not for clients.
+ */
+
+void empth_init_signals(void);
+
#endif