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
|
@ -54,18 +54,18 @@ empth_init(void **ctx, int flags)
|
|||
sigaddset(&set, SIGHUP);
|
||||
sigaddset(&set, SIGINT);
|
||||
sigaddset(&set, SIGTERM);
|
||||
lwpInitSystem(PP_MAIN, ctx, flags, &set);
|
||||
lwpInitSystem(1, ctx, flags, &set);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
if (!flags)
|
||||
flags = empth_flags;
|
||||
return lwpCreate(prio, entry, size, flags, name, 0, 0, ud);
|
||||
return lwpCreate(1, entry, size, flags, name, 0, 0, ud);
|
||||
}
|
||||
|
||||
empth_t *
|
||||
|
|
|
@ -418,7 +418,6 @@ empth_init(void **ctx_ptr, int flags)
|
|||
*
|
||||
* Create a new thread.
|
||||
*
|
||||
* prio - priority, not particularly useful in our context.
|
||||
* entry - entry point function for thread.
|
||||
* size - stack size.
|
||||
* flags - debug control.
|
||||
|
@ -429,7 +428,7 @@ empth_init(void **ctx_ptr, int flags)
|
|||
* It is also passed to the entry function...
|
||||
*/
|
||||
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)
|
||||
{
|
||||
empth_t *pThread = NULL;
|
||||
|
|
|
@ -180,14 +180,8 @@ empth_init(void **ctx_ptr, int flags)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* 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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue