[PATCH 1/3] coroipc: Don't spin when waiting on semaphore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Set timeout correctly before each call of sem_timedwait.

Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 include/corosync/coroipc_ipc.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/corosync/coroipc_ipc.h b/include/corosync/coroipc_ipc.h
index f04134d..ebba342 100644
--- a/include/corosync/coroipc_ipc.h
+++ b/include/corosync/coroipc_ipc.h
@@ -218,10 +218,10 @@ retry_sem_wait:
 			return (CS_ERR_LIBRARY);
 		}
 
+retry_sem_timedwait:
 		timeout.tv_sec = time(NULL) + IPC_SEMWAIT_TIMEOUT;
 		timeout.tv_nsec = 0;
 
-retry_sem_timedwait:
 		res = sem_timedwait (sem, &timeout);
 		if (res == -1 && errno == ETIMEDOUT) {
 			pfd.fd = fd;
-- 
1.7.1

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux