sched: remove on_thread_stack

no users in tree.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
sched: change thread list into an unordered map

A list can be slow to search for an element if we have many threads. Even under
normal load, the number of threads we span may not be classified as huge, but it
is not tiny either.

Change it to a map so we can implement functions that operate on a given thread
without that much overhead - O(1) for the common case. Note that ideally we would
use an unordered_set, that doesn't require an extra key. However, that would also
mean that the key is implicit and set to be of type key_type&. Threads are not very
lightweight to create for search purposes, so we go for a id-as-key approach.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
sched: add function to find a thread given its id

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
linux: add priority stubs

Cassandra is crashing for me in some invocations (I really don't understand how
it was running before), because it can't find setpriority and getpriority
symbols.

Since now we have priorities implemented in our scheduler, we can implement the
equivalent functions of linux' getpriority and setpriority. We will ignore all
non-thread entities for now (and possibly forever).

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Looks-Gooded-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>