* mmap.cc: Clean up *ResourceLock calls throughout.

* thread.cc (pthread_cond::TimedWait): Check for WAIT_TIMEOUT as well as
WAIT_ABANDONED.
(__pthread_cond_timedwait): Calculate a relative wait from the abstime
parameter.
This commit is contained in:
Christopher Faylor 2001-06-26 14:47:48 +00:00
parent d006404dae
commit 462f4effb1
15 changed files with 473 additions and 449 deletions

View File

@ -1,3 +1,14 @@
Tue Jun 26 10:47:24 2001 Christopher Faylor <cgf@cygnus.com>
* mmap.cc: Clean up *ResourceLock calls throughout.
Tue Jun 26 22:10:00 2001 Robert Collins rbtcollins@hotmail.com
* thread.cc (pthread_cond::TimedWait): Check for WAIT_TIMEOUT as well
as WAIT_ABANDONED.
(__pthread_cond_timedwait): Calculate a relative wait from the abstime
parameter.
Sun Jun 24 17:38:19 2001 Christopher Faylor <cgf@cygnus.com>
* exceptions.cc (interrupt_setup): Move actions from setup_handler to

View File

@ -68,7 +68,6 @@ public:
return 1;
return strncasematch (m->native_path, path, m->native_pathlen)
&& (path[m->native_pathlen] == '\\' || !path[m->native_pathlen]);
}
const char *unchroot (const char *path)
{

View File

@ -28,6 +28,13 @@
* malloc_usable_size(P) is equivalent to realloc(P, malloc_usable_size(P))
*
* $Log$
* Revision 1.3 2001/06/26 14:47:48 cgf
* * mmap.cc: Clean up *ResourceLock calls throughout.
* * thread.cc (pthread_cond::TimedWait): Check for WAIT_TIMEOUT as well as
* WAIT_ABANDONED.
* (__pthread_cond_timedwait): Calculate a relative wait from the abstime
* parameter.
*
* Revision 1.2 2001/06/24 22:26:49 cgf
* forced commit
*

View File

@ -974,7 +974,6 @@ private:
int audiobits_;
int audiochannels_;
bool setupwav(const char *pData, int nBytes);
public:
fhandler_dev_dsp (const char *name = 0);
~fhandler_dev_dsp();

View File

@ -27,7 +27,6 @@
/* for getpid */
#include <unistd.h>
/* Win32 priority to UNIX priority Mapping.
For now, I'm just following the spec: any range of priorities is ok.
There are probably many many issues with this...

View File

@ -44,6 +44,7 @@ details. */
#include "security.h"
#include <semaphore.h>
#include <stdio.h>
#include <sys/timeb.h>
extern int threadsafe;
@ -472,6 +473,7 @@ pthread_cond::TimedWait (DWORD dwMilliseconds)
case WAIT_FAILED:
return 0; /* POSIX doesn't allow errors after we modify the mutex state */
case WAIT_ABANDONED:
case WAIT_TIMEOUT:
return ETIMEDOUT;
case WAIT_OBJECT_0:
return 0; /* we have been signaled */
@ -1654,7 +1656,14 @@ __pthread_cond_timedwait (pthread_cond_t * cond, pthread_mutex_t * mutex,
return EINVAL;
if (!verifyable_object_isvalid (*cond, PTHREAD_COND_MAGIC))
return EINVAL;
struct timeb currSysTime;
long waitlength;
ftime(&currSysTime);
waitlength = (abstime->tv_sec - currSysTime.time) * 1000;
if (waitlength < 0)
return ETIMEDOUT;
/* if the cond variable is blocked, then the above timer test maybe wrong. *shrug* */
if (pthread_mutex_lock (&(*cond)->cond_access))
system_printf ("Failed to lock condition variable access mutex, this %0p\n", *cond);
@ -1671,7 +1680,7 @@ __pthread_cond_timedwait (pthread_cond_t * cond, pthread_mutex_t * mutex,
InterlockedIncrement (&((*themutex)->condwaits));
if (pthread_mutex_unlock (&(*cond)->cond_access))
system_printf ("Failed to unlock condition variable access mutex, this %0p\n", *cond);
rv = (*cond)->TimedWait (abstime->tv_sec * 1000);
rv = (*cond)->TimedWait (waitlength);
(*cond)->mutex->Lock ();
if (pthread_mutex_lock (&(*cond)->cond_access))
system_printf ("Failed to lock condition variable access mutex, this %0p\n", *cond);