Commit graph

27 commits

Author SHA1 Message Date
0a50a48141 Update known contributors comment. 2006-06-22 20:27:36 +00:00
1ca0b5cb2b Finally merge the journal patch:
(keep_journal): New econfig key.
(player_main): Log player login and logout.
(recvclient): Log player input.
(ef_open_srv, ef_close_srv): Log startup and shutdown.
(update_main): Log update.

Support the common SIGHUP log rotation idiom:
(empth_wait_for_shutdown, empth_wait_for_signal): Rename.
[EMPTH_LWP, EMPTH_POSIX] (empth_init, empth_wait_for_signal): Wait for
SIGHUP as well.
(main) [SIGHUP]: Reopen journal when empth_wait_for_signal() returns
SIGHUP.
2006-06-08 20:11:26 +00:00
7183516d91 (empth_init_signals): Don't catch SIGINT and SIGTERM.
(empth_wait_for_shutdown): New.
(main): Use it to wait for shutdown signal, then shut down.  Closes
#770492.
(empth_exit): Remove the weird special case for main thread.

Implement empth_wait_for_shutdown() for EMPTH_LWP:
[EMPTH_LWP] (lwpInitSigWait, lwpSigWait, lwpSigWakeup): New.
Declaration of lwpSigWait was accidentally committed in the previous
revision of lwp.h.
[EMPTH_LWP] (lwpInitSystem): New parameter waitset, pass it on to
lwpInitSigWait().
[EMPTH_LWP] (lwpReschedule): Call lwpSigWakeup().
[EMPTH_LWP] (empth_init): Declare signals needed by
empth_wait_for_shutdown().
(empth_wait_for_shutdown): Implement on top of lwpSigWait().

Implement empth_wait_for_shutdown() for EMPTH_POSIX:
[EMPTH_POSIX] (empth_init): Block signals, so that
empth_wait_for_shutdown() can use sigwait() safely.
(empth_wait_for_shutdown): Implement on top of sigwait().

Implement empth_wait_for_shutdown() for EMPTH_W32:
(empth_wait_for_shutdown): Implement on top of loc_BlockMainThread().
2006-06-07 21:01:16 +00:00
32e4fbd284 Move signal stuff into src/lib/empthread/, no functional change:
(empth_init_signals): New, factored out of start_server().  Call from
empth_init().
(panic): Move to posix.c, internal linkage.
(empth_obj): Add new posix.o

(empth_start, empth_alarm) [EMPTH_POSIX]: Clean up pointless messing
with signal handlers.
(empth_init, empth_wakeup) [EMPTH_POSIX]: Clean up a bit.
2006-06-05 08:51:02 +00:00
ba11aaaa36 (empth_create): LWP yields, and it's the reference implementation.
Document and fix the others.
2006-03-25 07:49:37 +00:00
f5a9284867 Update known contributors comment. 2006-02-24 21:35:27 +00:00
4515b84c59 COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is.  Update all
the references to these files.
2006-01-21 19:48:41 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
fa52e6944d Normalize inclusion guards: use NAME_H for name.h. Some headers
lacked them, others used reserved identifiers.
2005-12-29 10:16:01 +00:00
3b90d0cb81 (PP_MAIN, PP_UPDATE, PP_SHUTDOWN, PP_SCHED, PP_TIMESTAMP, PP_PLAYER)
(PP_ACCEPT, PP_KILLIDLE): Move from player.h to empthread.h and turn
into enumeration constants.
2005-12-28 21:21:15 +00:00
69150d10fc (EMPTH_LWP, EMPTH_POSIX, EMPTH_W32): Define in config.h instead of
compiler command line.  Don't bother to conditionalize code in .c
files that are only compiled when their thread package is used.

(_EMPTH_LWP, EMPTH_LWP, _EMPTH_POSIX, EMPTH_POSIX, _EMPTH_WIN32)
(EMPTH_W32): Identifiers beginning with an underscore and an uppercase
letter are reserved for any use.  Rename.
2005-12-28 14:27:15 +00:00
e6145fa515 (empth_start, empth_init) [_EMPTH_POSIX]: Do not handle SIGALRM. We
don't raise it, and the signal handler is fishy.
(empth_alarm): Unused, remove.
2005-10-26 16:30:00 +00:00
565faa8891 Cleanup, no functional change.
(empth_t, empth_sem_t): Define as incomplete types in empthread.h,
complete in pthread.c, to avoid exposing implementation details.

(EMPTH_KILLED): Move from empthread.h to pthread.c.
2005-07-23 17:40:49 +00:00
59c15ea9d4 [_DECTHREADS_] Drop support for DECthreads d4, a.k.a. DCE threads,
which are obsolete since at least 1997.

(empth_terminate, empth_wakeup) [__ppc__]: Ancient versions of OS X
lacked pthread_kill().  As a work-around, its use was disabled here
for all versions of OS X.  The work-around could lead to hangs.
Remove it and drop support for ancient versions of OS X.

(empth_create) [__linux__]: Linux has supported thread attribute
stacksize for ages.  Remove the special case.

(_MIT_POSIX_THREADS): Unused, remove.
2005-07-23 17:26:20 +00:00
d86c6e89ff Doc fix. 2005-07-01 19:51:48 +00:00
060df4ec8f Document Empire's thread abstraction. Minor cleanups:
(empth_init): Change first parameter to void **.
(empth_sleep): Change parameter to time_t.
2005-06-25 16:37:59 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
Ron Koenderink
9227a314c5 (service_stoppped,stop_service,loc_Ctrl_C_Handler,
empth_request_shutdown,loc_BlockMainThread,empth_init,
service_ctrl_handler) [_WIN32]: Remove the Windows Build UI and
replace with Ctrl-c signal trap.  The shutdown event that was used for
STOPPING the service is now used for both foreground and background
(service) modes of operation. Also move the shutdown event from service
code to empth_t library.
2005-03-15 18:19:07 +00:00
afa65c8f27 Break inclusion cycles. To simplify the change, move a few
declarations to other, no less sensible places.
2005-02-12 19:26:59 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
baabcc563e (empth_ctx_t): Unused, remove. 2004-08-28 12:49:13 +00:00
97843dfdf6 [_EMPTH_WIN32]: Previous rev. didn't even compile, fix. 2004-02-18 07:12:51 +00:00
e446bfd904 (empth_t, empth_sem_t) [_EMPTH_WIN32]: Use incomplete types, not void for
abstract data types.
2004-02-17 18:05:23 +00:00
237baffca9 Supply prototypes where possible. This uncovered type errors with
thread entrypoints:
(lwpSelect, shutdown_sequence): Parameters didn't match thread entry
point prototype.
(lwpEntryPoint): Arguments didn't match thread entry point prototype.

Change linkage of functions without prototype declaration to static
where possible.

Remove some superflous declarations, replace others by suitable
includes.
2004-02-17 17:59:30 +00:00
4fa84b5cb1 (emp_sig_t): Pre-ISO C compatibility cruft. Just use void. 2004-02-15 21:00:27 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00