Browse Source

JackPosixProcessSync: Remove TimedWait()

It isn't used anywhere and therefore I have no way or need to test
subsequent changes in it.

Signed-off-by: Maciej Wolny <maciej.wolny@codethink.co.uk>
pull/412/head
Maciej Wolny milloni 6 years ago
parent
commit
7130e4baa8
2 changed files with 0 additions and 33 deletions
  1. +0
    -32
      posix/JackPosixProcessSync.cpp
  2. +0
    -1
      posix/JackPosixProcessSync.h

+ 0
- 32
posix/JackPosixProcessSync.cpp View File

@@ -103,38 +103,6 @@ void JackPosixProcessSync::LockedWait()
}
}

bool JackPosixProcessSync::TimedWait(long usec)
{
ThrowIf(!pthread_equal(pthread_self(), fOwner), JackException("JackPosixProcessSync::TimedWait: a thread has to have locked a mutex before it can wait"));
fOwner = 0;

struct timeval T0, T1;
timespec time;
struct timeval now;
int res;

jack_log("JackPosixProcessSync::TimedWait time out = %ld", usec);
gettimeofday(&T0, 0);

gettimeofday(&now, 0);
unsigned int next_date_usec = now.tv_usec + usec;
time.tv_sec = now.tv_sec + (next_date_usec / 1000000);
time.tv_nsec = (next_date_usec % 1000000) * 1000;

res = pthread_cond_timedwait(&fCond, &fMutex, &time);
if (res != 0) {
jack_error("JackPosixProcessSync::TimedWait error usec = %ld err = %s", usec, strerror(res));
} else {
fOwner = pthread_self();
}

gettimeofday(&T1, 0);
jack_log("JackPosixProcessSync::TimedWait finished delta = %5.1lf",
(1e6 * T1.tv_sec - 1e6 * T0.tv_sec + T1.tv_usec - T0.tv_usec));

return (res == 0);
}

// TO DO : check thread consistency?
bool JackPosixProcessSync::LockedTimedWait(long usec)
{


+ 0
- 1
posix/JackPosixProcessSync.h View File

@@ -52,7 +52,6 @@ class JackPosixProcessSync : public JackBasePosixMutex
pthread_cond_destroy(&fCond);
}

bool TimedWait(long usec);
bool LockedTimedWait(long usec);

void Wait();


Loading…
Cancel
Save