From f4eae0641a1f69a6554f2035b7bc3fea70cde07c Mon Sep 17 00:00:00 2001 From: Stefan Sayer Date: Wed, 23 Feb 2011 12:03:23 +0100 Subject: [PATCH] b/f: wait_for_to for timeout>1s Patch by Robert Szokovacs rszokovacs gamatelecom dot hu --- core/AmThread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/AmThread.h b/core/AmThread.h index ed2cb086..ee7a95ed 100644 --- a/core/AmThread.h +++ b/core/AmThread.h @@ -164,8 +164,8 @@ public: bool ret = false; gettimeofday(&now, NULL); - timeout.tv_sec = now.tv_sec; - timeout.tv_nsec = (now.tv_usec + usec) * 1000; + timeout.tv_sec = now.tv_sec + (usec / 1000000); + timeout.tv_nsec = (now.tv_usec + (usec % 1000000)) * 1000; pthread_mutex_lock(&m); while(!t && !retcode){