pthread: implement pthread yield

trivial wrapper around sched::yield

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
bsd: wire get_cyclecount() to processor::ticks()

Currently it is wired to osv::clock::uptime::now() and later trimmed
to 1ms accurracy of a BSD tick. However it is supposed to provide raw
"TSC" access with highest accurracy possible, global monotonicity is
not important. It is used only by entropy harvesting routines. Quoting
the manual:

  "The get_cyclecount() function uses a register available in most
   modern CPUs to return a value that is monotonically increasing inside
   each CPU.

   (...)

   The AMD64 and Intel 64 processors use the TSC register."

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Bump up apps.git pointer

Signed-off-by: Tomasz Grabiec <tgrabiec@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
tests: Test thread_local support

This is a test for our support of the thread_local C++11 feature.
We support the construction and use of these variables correctly, but as
this test demonstrates, we neglect to run the variable's destructor when
a thread ends, so this test currently fails on OSv (it succeeds on Linux).

Because the test is currently failing, I added it to the blacklist of
ignored tests. But it is still useful to have this test around, to
remember exactly what needs to be fixed for thread_local support.

I also opened issue #373 in our bug tracker to explain and track this issue.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
net: avoid more tcp_close() in tcp_do_segment()

Commit 8340e21b58b ("net: don't close the tcp connection within
tcp_do_segment()") removed calls to tcp_close() from within tcp_do_segment(),
as preparation for net channels, but missed two cases where tcp_drop() calls
tcp_close().  This causes a locking mismatch when a TH_ACK|TH_RST packet is
received.

Fix by calling a new function tcp_drop_noclose() instead, and set want_close
for deferred closing.

Seen with a Tomcat workload with many (600) connections.

Reviewed-by: Tomasz Grabiec <tgrabiec@gmail.com>
Signed-off-by: Avi Kivity <avi@cloudius-systems.com>