'tickets' can use 'threads' now

git-svn-id: svn://ttmath.org/publicrep/winix/trunk@706 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-01-20 18:37:51 +00:00
parent 3fad25b8c8
commit ab84a5169e
61 changed files with 1928 additions and 980 deletions

View File

@@ -31,8 +31,7 @@ size_t i;
Plugin::Plugin()
{
current_plugin = -1;
request = 0;
current_plugin = -1;
db = 0;
config = 0;
@@ -42,6 +41,9 @@ Plugin::Plugin()
templates = 0;
synchro = 0;
session_manager = 0;
ret_false = 0;
ret_true = 0;
}
@@ -284,10 +286,17 @@ void Plugin::Call(int message, Slots::iterator & slot)
void Plugin::Call(int message, void * p1_, void * p2_, long l1_, long l2_)
{
// how many plugins return 'false' and 'true'
// we are using local variables because Call() method can be called
// from a plugin too (one Call() can execute another Call())
int ret_false_loc = 0;
int ret_true_loc = 0;
int old_current_plugin = current_plugin;
Slots::iterator i = slots.lower_bound(message);
int old_current_plugin = current_plugin;
for( ; i!=slots.end() && i->first==message ; ++i )
{
@@ -298,9 +307,16 @@ void Plugin::Call(int message, void * p1_, void * p2_, long l1_, long l2_)
info.l2 = l2_;
Call(message, i);
if( info.res )
++ret_true_loc;
else
++ret_false_loc;
}
current_plugin = old_current_plugin;
ret_false = ret_false_loc;
ret_true = ret_true_loc;
}
@@ -352,8 +368,6 @@ void Plugin::Call(int message, void * p1_, void * p2_, long l1_)
}
size_t Plugin::Size()
{
return plugins.size();
@@ -361,6 +375,19 @@ size_t Plugin::Size()
int Plugin::True()
{
return ret_true;
}
int Plugin::False()
{
return ret_false;
}
void Plugin::Assign(int message, Fun1 fun1)
{
Slot s;