]> sourceware.org Git - newlib-cygwin.git/commit
cygserver: Revamp thread sleep handling
authorCorinna Vinschen <corinna@vinschen.de>
Fri, 24 Mar 2017 15:45:32 +0000 (16:45 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Fri, 24 Mar 2017 16:53:34 +0000 (17:53 +0100)
commitb80b2c011936f7f075b76b6e59f9e8a5ec49caa1
treeb545ab1c0bfcbe015221bfdd268a621cf83bf17c
parent0b73dba4de3fdadde499edfbc7ca9d9a01c11487
cygserver: Revamp thread sleep handling

The current implementation is a very simple approach to implement
a statically sized sleep queue.  The problem is that this code requires
a certain amount of synchronization because the slots in the queue are
used dynamically.  To top it off, the Event objects used for sync'ing
are created and destroyed on demand.  This is complicated, slow, and
error prone.

There's also a blatant bug here: The number of slots in the queue was
wrongly computed in size.  It was too small if XSI IPC was used a lot.

Make the code more robust.  Let the queue have the right size.  Every
slot is now used for a specific IPC object.  All sync objects (switched
to Semaphores) are only created when first required, but never destroyed.
This reduces the usage of a critical section to the creation of a new
sync object.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygserver/bsd_mutex.cc
winsup/cygserver/bsd_mutex.h
winsup/cygserver/sysv_msg.cc
winsup/cygserver/sysv_sem.cc
winsup/cygserver/sysv_shm.cc
This page took 0.02975 seconds and 5 git commands to generate.