]> git.pond.sub.org Git - empserver/blobdiff - include/empthread.h
(empth_init_signals): Don't catch SIGINT and SIGTERM.
[empserver] / include / empthread.h
index 16bc37cfe54e87f0173bd3f754fddddcdd2b220b..172e89a0d9917405b547620fd7ae693eee27b6d3 100644 (file)
@@ -31,6 +31,7 @@
  *     Sasha Mikheev
  *     Doug Hay, 1998
  *     Steve McClure, 1998
+ *     Markus Armbruster, 2005
  */
 
 /*
@@ -130,6 +131,7 @@ int empth_init(void **ctx, int flags);
  * 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 *),
@@ -142,6 +144,9 @@ empth_t *empth_self(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);
@@ -182,6 +187,12 @@ void empth_wakeup(empth_t *thread);
  */
 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.
@@ -209,4 +220,11 @@ void empth_sem_signal(empth_sem_t *sem);
  */
 void empth_sem_wait(empth_sem_t *sem);
 
+
+/*
+ * Stuff for implementations, not for clients.
+ */
+
+void empth_init_signals(void);
+
 #endif