*** empty log message ***

git-svn-id: http://voip.null.ro/svn/yate@491 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2005-08-19 23:21:31 +00:00
parent d8dce7d20b
commit ef69dbdb7a
3 changed files with 39 additions and 2 deletions

View File

@ -754,6 +754,8 @@ void Client::line(int newLine)
void Client::callAccept(const char* callId)
{
Debug(ClientDriver::self(),DebugInfo,"callAccept('%s')",callId);
if (!driverLockLoop())
return;
ClientChannel* cc = static_cast<ClientChannel*>(ClientDriver::self()->find(callId));
if (cc) {
cc->ref();
@ -761,6 +763,7 @@ void Client::callAccept(const char* callId)
setChannelInternal(cc);
cc->deref();
}
driverUnlock();
}
void Client::callReject(const char* callId)
@ -793,8 +796,11 @@ bool Client::callStart(const String& target, const String& line,
target.c_str(),line.c_str(),proto.c_str(),account.c_str());
if (target.null())
return false;
if (!driverLockLoop())
return false;
ClientChannel* cc = new ClientChannel(target);
Message* m = cc->message("call.route");
driverUnlock();
Regexp r("^[a-z0-9]\\+/");
bool hasProto = r.matches(target.safe());
if (hasProto)
@ -931,6 +937,33 @@ void Client::idleActions()
tmp->process();
}
bool Client::driverLock(long maxwait)
{
if (maxwait < 0)
maxwait = 0;
return ClientDriver::self() && ClientDriver::self()->lock(maxwait);
}
bool Client::driverLockLoop()
{
if (!(isCurrent() && ClientDriver::self()))
return false;
while (!driverLock()) {
if (Engine::exiting() || !ClientDriver::self())
return false;
idleActions();
yield();
}
return true;
}
void Client::driverUnlock()
{
if (ClientDriver::self())
ClientDriver::self()->unlock();
}
bool UIHandler::received(Message &msg)
{

View File

@ -30,6 +30,7 @@ style "window" {
bg[NORMAL] = { 0.75, 0.80, 0.71 }
bg[ACTIVE] = { 0.58, 0.67, 0.57 }
bg[PRELIGHT] = { 0.66, 0.74, 0.64 }
font_name = "Sans 10"
}
style "button" {
@ -40,8 +41,8 @@ style "button" {
style "border" {
bg[NORMAL] = { 0.91, 0.47, 0.10 }
xthickness = 2
ythickness = 2
xthickness = 3
ythickness = 3
}
style "decoration" {

View File

@ -185,6 +185,9 @@ protected:
void enableAction(const ClientChannel* chan, const String& action);
inline bool needProxy() const
{ return m_oneThread && !isCurrent(); }
bool driverLockLoop();
static bool driverLock(long maxwait = 0);
static void driverUnlock();
ObjList m_windows;
String m_activeId;
int m_line;