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.
This commit is contained in:
@@ -35,13 +35,6 @@ enum cw_cancel_action
|
||||
cw_no_cancel
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
void SetResourceLock (int, int, const char *) __attribute__ ((regparm (3)));
|
||||
void ReleaseResourceLock (int, int, const char *)
|
||||
__attribute__ ((regparm (3)));
|
||||
}
|
||||
|
||||
DWORD cancelable_wait (HANDLE, DWORD, const cw_cancel_action = cw_cancel_self,
|
||||
const enum cw_sig_wait = cw_sig_nosig)
|
||||
__attribute__ ((regparm (3)));
|
||||
@@ -92,17 +85,6 @@ private:
|
||||
class per_process;
|
||||
class pinfo;
|
||||
|
||||
class ResourceLocks
|
||||
{
|
||||
public:
|
||||
LPCRITICAL_SECTION Lock (int);
|
||||
void Init ();
|
||||
void Delete ();
|
||||
private:
|
||||
CRITICAL_SECTION lock;
|
||||
bool inited;
|
||||
};
|
||||
|
||||
#define PTHREAD_MAGIC 0xdf0df045
|
||||
#define PTHREAD_MUTEX_MAGIC PTHREAD_MAGIC+1
|
||||
#define PTHREAD_KEY_MAGIC PTHREAD_MAGIC+2
|
||||
|
Reference in New Issue
Block a user