Remove the concept of thread priorities from empthread.h. Only LWP
supports priorities. Update synchronization used to rely on them, which naturally worked only with LWP (#1504036). With that fixed, no uses of priorities remained, but a minor bug did: players could starve out threads with priorities below PP_PLAYER, i.e. delete_lostitems() and player_kill_idle(). Closes #1458175: (empth_create): Remove parameter prio. Callers changed. Also gets rid of misleading comments in pthread.c and ntthread.c. (PP_MAIN, PP_UPDATE, PP_SHUTDOWN, PP_SCHED, PP_TIMESTAMP, PP_PLAYER) (PP_ACCEPT, PP_KILLIDLE): Remove. (empth_init, empth_create) [EMPTH_LWP]: Pass priority 1.
This commit is contained in:
parent
7536a38e95
commit
d500a7071c
9 changed files with 13 additions and 38 deletions
|
@ -51,18 +51,6 @@
|
|||
|
||||
#include <time.h>
|
||||
|
||||
/* thread priorities */
|
||||
enum {
|
||||
PP_MAIN = 7,
|
||||
PP_UPDATE = 6,
|
||||
PP_SHUTDOWN = 5,
|
||||
PP_SCHED = 4,
|
||||
PP_TIMESTAMP = 2,
|
||||
PP_PLAYER = 3,
|
||||
PP_ACCEPT = 3,
|
||||
PP_KILLIDLE = 2
|
||||
};
|
||||
|
||||
#ifdef EMPTH_LWP
|
||||
#include "lwp.h"
|
||||
|
||||
|
@ -123,7 +111,6 @@ int empth_init(void **ctx, int flags);
|
|||
|
||||
/*
|
||||
* Create a new thread.
|
||||
* PRIO is the scheduling priority.
|
||||
* ENTRY is the entry point. It will be called with argument UD.
|
||||
* Thread stack is at least SIZE bytes.
|
||||
* FLAGS should be the same as were passed to empth_init(), or zero.
|
||||
|
@ -134,7 +121,7 @@ int empth_init(void **ctx, int flags);
|
|||
* Yield the processor.
|
||||
* Return the thread, or NULL on error.
|
||||
*/
|
||||
empth_t *empth_create(int prio, void (*entry)(void *),
|
||||
empth_t *empth_create(void (*entry)(void *),
|
||||
int size, int flags, char *name, void *ud);
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue