From 208b983734d7431699f4bd3534e08321e42ada86 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 6 Oct 2011 03:25:22 +0000 Subject: Renamed most of the core threading system, some ancillary systems need some kind of prefix or something, we could stick with Ito, I will until I think of something else. --- src/itocondition.cpp | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 src/itocondition.cpp (limited to 'src/itocondition.cpp') diff --git a/src/itocondition.cpp b/src/itocondition.cpp deleted file mode 100644 index 3d8db60..0000000 --- a/src/itocondition.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (C) 2007-2011 Xagasoft, All rights reserved. - * - * This file is part of the libbu++ library and is released under the - * terms of the license contained in the file LICENSE. - */ - -#include - -#include "bu/itocondition.h" - -Bu::ItoCondition::ItoCondition() -{ - pthread_cond_init( &cond, NULL ); -} - -Bu::ItoCondition::~ItoCondition() -{ - pthread_cond_destroy( &cond ); -} - -int Bu::ItoCondition::wait() -{ - return pthread_cond_wait( &cond, &mutex ); -} - -int Bu::ItoCondition::wait( int nSec, int nUSec ) -{ - struct timeval now; - struct timespec timeout; - struct timezone tz; - - gettimeofday( &now, &tz ); - timeout.tv_sec = now.tv_sec + nSec + ((now.tv_usec + nUSec)/1000000); - timeout.tv_nsec = ((now.tv_usec + nUSec)%1000000)*1000; - - return pthread_cond_timedwait( &cond, &mutex, &timeout ); -} - -int Bu::ItoCondition::signal() -{ - return pthread_cond_signal( &cond ); -} - -int Bu::ItoCondition::broadcast() -{ - return pthread_cond_broadcast( &cond ); -} - -- cgit v1.2.3