Run clang-format

This commit is contained in:
Bassem Girgis
2018-10-18 00:40:34 -05:00
parent fffe4528da
commit 31c32e368a
149 changed files with 5974 additions and 6287 deletions

View File

@@ -1,64 +1,68 @@
#include <mutex>
class hierarchical_mutex
{
class hierarchical_mutex {
public:
explicit hierarchical_mutex(unsigned level)
{}
void lock()
{}
void unlock()
{}
};
explicit hierarchical_mutex(unsigned level) {}
void lock() {}
void unlock() {}
};
hierarchical_mutex high_level_mutex(10000);
hierarchical_mutex low_level_mutex(5000);
int do_low_level_stuff()
int
do_low_level_stuff()
{
return 42;
return 42;
}
int low_level_func()
int
low_level_func()
{
std::lock_guard<hierarchical_mutex> lk(low_level_mutex);
return do_low_level_stuff();
std::lock_guard<hierarchical_mutex> lk(low_level_mutex);
return do_low_level_stuff();
}
void high_level_stuff(int some_param)
{}
void high_level_func()
void
high_level_stuff(int some_param)
{
std::lock_guard<hierarchical_mutex> lk(high_level_mutex);
high_level_stuff(low_level_func());
}
void thread_a()
void
high_level_func()
{
high_level_func();
std::lock_guard<hierarchical_mutex> lk(high_level_mutex);
high_level_stuff(low_level_func());
}
void
thread_a()
{
high_level_func();
}
hierarchical_mutex other_mutex(100);
void do_other_stuff()
{}
void other_stuff()
void
do_other_stuff()
{
high_level_func();
do_other_stuff();
}
void thread_b()
void
other_stuff()
{
std::lock_guard<hierarchical_mutex> lk(other_mutex);
other_stuff();
high_level_func();
do_other_stuff();
}
int main()
{}
void
thread_b()
{
std::lock_guard<hierarchical_mutex> lk(other_mutex);
other_stuff();
}
int
main()
{
}