1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -34,52 +34,52 @@ using namespace std;
int thecount = 0;
boost::mutex mutex;
// Functor class
// Functor class
struct foo
{
void operator ()()
{
for (int i = 0; i < 1024*1024*10; i++)
// simulate some work
fData++;
void operator ()()
{
for (int i = 0; i < 1024 * 1024 * 10; i++)
// simulate some work
fData++;
//boost::mutex::scoped_lock lock(mutex);
//std::cout << "foo count = " << ++thecount << " " << fData << std::endl;
}
//boost::mutex::scoped_lock lock(mutex);
//std::cout << "foo count = " << ++thecount << " " << fData << std::endl;
}
foo(int i):
fData(i)
foo(int i):
fData(i)
{}
foo(const foo& copy)
: fData(copy.fData)
{}
foo(const foo& copy)
: fData(copy.fData)
{}
int fData;
int fData;
};
int main( int argc, char **argv)
int main( int argc, char** argv)
{
threadpool::WeightedThreadPool pool( 100, 10, 5 );
threadpool::WeightedThreadPool pool( 100, 10, 5 );
for (int y = 0; y < 10; y++)
{
for (int y = 0; y < 10; y++)
{
foo bar(y);
for (int i = 0; i < 10; ++i)
{
pool.invoke(bar, 25);
pool.invoke(bar, 25);
}
boost::mutex::scoped_lock lock(mutex);
std::cout << "count = " << ++thecount << std::endl;
// Wait until all of the queued up and in-progress work has finished
pool.wait();
pool.dump();
}
}
}