1
/***************************************************************************
2
cmanager.cpp - description
4
begin : Thu Jan 23 2003
5
copyright : (C) 2003 by Mathias K�ster
6
email : mathen@users.berlios.de
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
25
#include <dclib/dcos.h>
26
#include <dclib/core/cdir.h>
27
#include <dclib/core/cplugin.h>
28
#include <dclib/core/platform.h>
47
void CManager::Add( _CCallback * callback )
52
m_ThreadList.Add(callback);
53
m_ThreadList.UnLock();
58
void CManager::Remove( _CCallback * callback )
63
m_ThreadList.Remove(callback);
64
m_ThreadList.UnLock();
69
void CManager::Thread( CObject * )
71
struct timeval tv_old, tv_new;
72
_CCallback * callback = 0;
75
gettimeofday(&tv_old, NULL);
81
callback = m_ThreadList.Next(callback);
83
m_ThreadList.UnLock();
90
callback->notify(0,0);
93
gettimeofday(&tv_new, NULL);
95
if ( (tv_new.tv_sec - tv_old.tv_sec) > 0 )
101
i = (tv_new.tv_usec - tv_old.tv_usec);
115
//printf("%d %d %d\n",i,tv_new.tv_sec - tv_old.tv_sec,(tv_new.tv_usec - tv_old.tv_usec)/1000);