OSDN Git Service

* dcrt0.cc (_dll_crt0): Set _main_tls as early as possible.
authorcgf <cgf>
Wed, 10 Feb 2010 07:25:25 +0000 (07:25 +0000)
committercgf <cgf>
Wed, 10 Feb 2010 07:25:25 +0000 (07:25 +0000)
commita3db0b1cf7ce5b8f71f403c69cea9b92c3eba59d
tree8e9df93736212a68eba9774bdc5b4ff281695268
parent2afc92aab7b36973ab00733e7f8d104bbeb8e9ca
* dcrt0.cc (_dll_crt0): Set _main_tls as early as possible.
* thread.cc (pthread_mutex::can_be_unlocked): Remove check for
MUTEX_OWNER_ANONYMOUS since it is racy and unsafe.
(pthread::init_mainthread): Initialize thread directly from _my_tls.
(pthread::self): Ditto.
(pthread::get_tls_self_pointer): Delete.
(pthread_mutex::pthread_mutex): Use an event rather than a semaphore.
(pthread_mutex::lock): Rename from _<func>.  Derive self directly.
(pthread_mutex::tryunlock): Ditto.
(pthread_mutex::destroy): Ditto.
(pthread_mutex::unlock): Ditto.  Accommodate change from semaphore to event.
(pthread_mutex::_fixup_after_fork): Accommodate change from semaphore to event.
(pthread_mutex::init): Don't attempt to initialize a semaphore unless it is in
an initialized state.  Do this check under mutex_initialization_lock.lock
* thread.h (fast_mutex::init): Use event rather than semaphore.
(fast_mutex::lock): Ditto.
(pthread_mutex::_lock): Delete.
(pthread_mutex::_unlock): Ditto.
(pthread_mutex::_trylock): Ditto.
(pthread_mutex::_destroy): Ditto.
(pthread_mutex::get_pthread_self): Ditto.
(pthread_mutex::get_tls_self_pointer): Ditto.
(pthread_mutex::lock): Un-inline.
(pthread_mutex::unlock): Ditto.
(pthread_mutex::trylock): Ditto.
(pthread_mutex::destroy): Ditto.
winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc
winsup/cygwin/thread.cc
winsup/cygwin/thread.h