diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2011-03-15 20:48:52 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2011-03-19 08:30:28 +0000 |
commit | 44bc10d5bcb1957f76925b849488288f74f623b7 (patch) | |
tree | 11e56af90b0b2e78bf058fdd5058ce660b67d8d2 | |
parent | 1a290aea8dd25bd8a6d0edb945b120ea26fc05e0 (diff) |
qemu-thread: delete unused functions
qemu_mutex_timedlock() and qemu_cond_timedwait() are no longer used.
Remove them and their helper timespec_add_ms().
Reported-by: François Revol <revol@free.fr>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
-rw-r--r-- | qemu-thread-posix.c | 38 | ||||
-rw-r--r-- | qemu-thread.h | 2 |
2 files changed, 0 insertions, 40 deletions
diff --git a/qemu-thread-posix.c b/qemu-thread-posix.c index 87c1a9fd93..2bd02efeff 100644 --- a/qemu-thread-posix.c +++ b/qemu-thread-posix.c @@ -61,30 +61,6 @@ int qemu_mutex_trylock(QemuMutex *mutex) return pthread_mutex_trylock(&mutex->lock); } -static void timespec_add_ms(struct timespec *ts, uint64_t msecs) -{ - ts->tv_sec = ts->tv_sec + (long)(msecs / 1000); - ts->tv_nsec = (ts->tv_nsec + ((long)msecs % 1000) * 1000000); - if (ts->tv_nsec >= 1000000000) { - ts->tv_nsec -= 1000000000; - ts->tv_sec++; - } -} - -int qemu_mutex_timedlock(QemuMutex *mutex, uint64_t msecs) -{ - int err; - struct timespec ts; - - clock_gettime(CLOCK_REALTIME, &ts); - timespec_add_ms(&ts, msecs); - - err = pthread_mutex_timedlock(&mutex->lock, &ts); - if (err && err != ETIMEDOUT) - error_exit(err, __func__); - return err; -} - void qemu_mutex_unlock(QemuMutex *mutex) { int err; @@ -139,20 +115,6 @@ void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex) error_exit(err, __func__); } -int qemu_cond_timedwait(QemuCond *cond, QemuMutex *mutex, uint64_t msecs) -{ - struct timespec ts; - int err; - - clock_gettime(CLOCK_REALTIME, &ts); - timespec_add_ms(&ts, msecs); - - err = pthread_cond_timedwait(&cond->cond, &mutex->lock, &ts); - if (err && err != ETIMEDOUT) - error_exit(err, __func__); - return err; -} - void qemu_thread_create(QemuThread *thread, void *(*start_routine)(void*), void *arg) diff --git a/qemu-thread.h b/qemu-thread.h index acdb6b2339..edc7ab6858 100644 --- a/qemu-thread.h +++ b/qemu-thread.h @@ -15,7 +15,6 @@ void qemu_mutex_init(QemuMutex *mutex); void qemu_mutex_destroy(QemuMutex *mutex); void qemu_mutex_lock(QemuMutex *mutex); int qemu_mutex_trylock(QemuMutex *mutex); -int qemu_mutex_timedlock(QemuMutex *mutex, uint64_t msecs); void qemu_mutex_unlock(QemuMutex *mutex); void qemu_cond_init(QemuCond *cond); @@ -29,7 +28,6 @@ void qemu_cond_destroy(QemuCond *cond); void qemu_cond_signal(QemuCond *cond); void qemu_cond_broadcast(QemuCond *cond); void qemu_cond_wait(QemuCond *cond, QemuMutex *mutex); -int qemu_cond_timedwait(QemuCond *cond, QemuMutex *mutex, uint64_t msecs); void qemu_thread_create(QemuThread *thread, void *(*start_routine)(void*), |