From a1591d3be7fefcec8056bf5f74be0590fb356605 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 27 Nov 2007 14:45:14 +0000 Subject: Drop old SetResourceLock stuff in favor of mutos. * dcrt0.cc (_reslock): Remove. (__cygwin_user_data): Accommodate removal of resourcelocks member. (dll_crt0_0): Don't initialize resourcelocks. * exceptions.cc (_cygtls::signal_exit): Drop resourcelocks handling. * mmap.cc (mmap_guard): New muto. (LIST_LOCK): Define. (LIST_UNLOCK): Define. (mmap_list::search_record): Remove. (mmap_list::try_map): Include code for anonymous case from mmap_list::search_record. (mmap_is_attached_or_noreserve): Access bookkeeping lists in a thread safe way. (mmap64): Replace SetResourceLock/ReleaseResourceLock by LIST_LOCK/LIST_UNLOCK. Lock at the latest possible point. (munmap): Replace SetResourceLock/ReleaseResourceLock by LIST_LOCK/LIST_UNLOCK. (msync): Ditto. (mprotect): Ditto. * thread.cc (ResourceLocks::Lock): Remove. (SetResourceLock): Remove. (ReleaseResourceLock): Remove. (ResourceLocks::Init): Remove. (ResourceLocks::Delete): Remove. * thread.h (SetResourceLock): Drop declaration. (ReleaseResourceLock): Ditto. (class ResourceLocks): Drop definition. * include/sys/cygwin.h (class ResourceLocks): Drop forward declaration. (struct per_process): Replace resourcelocks with additional unused2 element. (per_process_overwrite): Accommodate above change. --- winsup/cygwin/thread.cc | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'winsup/cygwin/thread.cc') diff --git a/winsup/cygwin/thread.cc b/winsup/cygwin/thread.cc index 96397f5b0..d72692f05 100644 --- a/winsup/cygwin/thread.cc +++ b/winsup/cygwin/thread.cc @@ -286,43 +286,6 @@ semaphore::is_good_object (sem_t const * sem) return true; } -LPCRITICAL_SECTION -ResourceLocks::Lock (int _resid) -{ - return &lock; -} - -void -SetResourceLock (int _res_id, int _mode, const char *_function) -{ - EnterCriticalSection (user_data->resourcelocks->Lock (_res_id)); -} - -void -ReleaseResourceLock (int _res_id, int _mode, const char *_function) -{ - LeaveCriticalSection (user_data->resourcelocks->Lock (_res_id)); -} - -void -ResourceLocks::Init () -{ - InitializeCriticalSection (&lock); - inited = true; - thread_printf ("lock %p inited by %p , %d", &lock, user_data, myself->pid); -} - -void -ResourceLocks::Delete () -{ - if (inited) - { - thread_printf ("Close Resource Locks %p ", &lock); - DeleteCriticalSection (&lock); - inited = false; - } -} - void MTinterface::Init () { -- cgit v1.2.3