Browse Source

Tim Blechmann patch for JackPosixSemaphore (still to test...).

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2381 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 17 years ago
parent
commit
1a56f6256d
2 changed files with 11 additions and 12 deletions
  1. +4
    -0
      ChangeLog
  2. +7
    -12
      common/JackPosixSemaphore.cpp

+ 4
- 0
ChangeLog View File

@@ -20,6 +20,10 @@ Fernando Lopez-Lezcano
Jackdmp changes log
---------------------------

2008-05-29 Stephane Letz <letz@grame.fr>

* Tim Blechmann patch for JackPosixSemaphore (still to test...).

2008-05-28 Stephane Letz <letz@grame.fr>

* New testMutex test, correct timing in drivers.


+ 7
- 12
common/JackPosixSemaphore.cpp View File

@@ -97,10 +97,9 @@ bool JackPosixSemaphore::Wait()
}


/*
#ifdef __linux__
#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) // glibc feature test

bool JackPosixSemaphore::TimedWait(long usec) // unusable semantic !!
bool JackPosixSemaphore::TimedWait(long usec)
{
int res;
struct timeval now;
@@ -112,7 +111,11 @@ bool JackPosixSemaphore::TimedWait(long usec) // unusable semantic !!
}
gettimeofday(&now, 0);
time.tv_sec = now.tv_sec + usec / 1000000;
time.tv_nsec = (now.tv_usec + (usec % 1000000)) * 1000;
long tv_usec = (now.tv_usec + (usec % 1000000));

time.tv_sec += tv_usec / 1000000;

time.tv_nsec = (tv_usec % 1000000) * 1000;

if ((res = sem_timedwait(fSemaphore, &time)) != 0) {
jack_error("JackPosixSemaphore::TimedWait err = %s", strerror(errno));
@@ -130,14 +133,6 @@ bool JackPosixSemaphore::TimedWait(long usec)
return Wait();
}
#endif
*/

#warning JackPosixSemaphore::TimedWait not available : synchronous mode may not work correctly if POSIX semaphore are used

bool JackPosixSemaphore::TimedWait(long usec)
{
return Wait();
}

// Server side : publish the semaphore in the global namespace
bool JackPosixSemaphore::Allocate(const char* name, const char* server_name, int value)


Loading…
Cancel
Save