diff --git a/posix/JackPosixProcessSync.cpp b/posix/JackPosixProcessSync.cpp index 04c8785f..7902abe7 100644 --- a/posix/JackPosixProcessSync.cpp +++ b/posix/JackPosixProcessSync.cpp @@ -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) { diff --git a/posix/JackPosixProcessSync.h b/posix/JackPosixProcessSync.h index 956d39c3..286c4d90 100644 --- a/posix/JackPosixProcessSync.h +++ b/posix/JackPosixProcessSync.h @@ -52,7 +52,6 @@ class JackPosixProcessSync : public JackBasePosixMutex pthread_cond_destroy(&fCond); } - bool TimedWait(long usec); bool LockedTimedWait(long usec); void Wait();