* Makefile.in: Build wincap.o.
* wincap.cc: New file. * wincap.h: Ditto. * autoload.cc: Add dynamic load statement for `CreateHardLinkA'. * dcrt0.cc (os_being_run): Eliminated. (osname): Ditto. (iswinnt): Ditto. (set_os_type): Ditto. (dll_crt0_1): Call wincap.init() instead of set_os_type(). (_dll_crt0): Ditto. * environ.cc (set_chunksize): New function. (parse_thing): `forkchunk' setting now invokes function `set_chunksize'. * fork.cc (chunksize): Eliminated. Moved to be member of wincap. * host_dependent.h: Removed. * syscalls.cc (_link): Try using `CreateHardLinkA' first, if available. * cygheap.cc, dcrt0.cc, delqueue.cc, dir.cc, environ.cc, fhandler.cc, fhandler.h, fhandler_console.cc, fhandler_mem.cc, fork.cc, mmap.cc, net.cc, pinfo.cc, pinfo.h, security.cc, syscalls.cc, sysconf.cc, syslog.cc, thread.cc, times.cc, tty.cc, uinfo.cc, uname.cc, winsup.h: Use new wincap capability check throughout. * winsup.h: Include wincap.h. Eliminate extern declarations of `os_being_run' and `iswinnt'. Eliminate `os_type" definition. * include/cygwin/version.h: Bump version to 1.3.4.
This commit is contained in:
@@ -499,7 +499,7 @@ int
|
||||
pthread_cond::TimedWait (DWORD dwMilliseconds)
|
||||
{
|
||||
DWORD rv;
|
||||
if (!iswinnt)
|
||||
if (!wincap.has_signal_object_and_wait ())
|
||||
{
|
||||
// FIXME: race condition (potentially drop events
|
||||
// Possible solution (single process only) - place this in a critical section.
|
||||
@@ -621,7 +621,7 @@ pthread_mutex::pthread_mutex (pthread_mutexattr *attr):verifyable_object (PTHREA
|
||||
magic = 0;
|
||||
return;
|
||||
}
|
||||
if (iswinnt)
|
||||
if (wincap.has_try_enter_critical_section ())
|
||||
InitializeCriticalSection (&criticalsection);
|
||||
else
|
||||
{
|
||||
@@ -637,7 +637,7 @@ pthread_mutex::pthread_mutex (pthread_mutexattr *attr):verifyable_object (PTHREA
|
||||
|
||||
pthread_mutex::~pthread_mutex ()
|
||||
{
|
||||
if (iswinnt)
|
||||
if (wincap.has_try_enter_critical_section ())
|
||||
DeleteCriticalSection (&criticalsection);
|
||||
else
|
||||
{
|
||||
@@ -663,7 +663,7 @@ pthread_mutex::~pthread_mutex ()
|
||||
int
|
||||
pthread_mutex::Lock ()
|
||||
{
|
||||
if (iswinnt)
|
||||
if (wincap.has_try_enter_critical_section ())
|
||||
{
|
||||
EnterCriticalSection (&criticalsection);
|
||||
return 0;
|
||||
@@ -676,7 +676,7 @@ pthread_mutex::Lock ()
|
||||
int
|
||||
pthread_mutex::TryLock ()
|
||||
{
|
||||
if (iswinnt)
|
||||
if (wincap.has_try_enter_critical_section ())
|
||||
return (!TryEnterCriticalSection (&criticalsection));
|
||||
return (WaitForSingleObject (win32_obj_id, 0) == WAIT_TIMEOUT);
|
||||
}
|
||||
@@ -684,7 +684,7 @@ pthread_mutex::TryLock ()
|
||||
int
|
||||
pthread_mutex::UnLock ()
|
||||
{
|
||||
if (iswinnt)
|
||||
if (wincap.has_try_enter_critical_section ())
|
||||
{
|
||||
LeaveCriticalSection (&criticalsection);
|
||||
return 0;
|
||||
@@ -699,7 +699,7 @@ pthread_mutex::fixup_after_fork ()
|
||||
if (pshared != PTHREAD_PROCESS_PRIVATE)
|
||||
api_fatal("pthread_mutex::fixup_after_fork () doesn'tunderstand PROCESS_SHARED mutex's\n");
|
||||
/* FIXME: duplicate code here and in the constructor. */
|
||||
if (iswinnt)
|
||||
if (wincap.has_try_enter_critical_section ())
|
||||
InitializeCriticalSection(&criticalsection);
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user