Run clang-format
This commit is contained in:
@@ -1,28 +1,25 @@
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
struct some_resource
|
||||
{
|
||||
void do_something()
|
||||
{}
|
||||
|
||||
struct some_resource {
|
||||
void do_something() {}
|
||||
};
|
||||
|
||||
|
||||
std::shared_ptr<some_resource> resource_ptr;
|
||||
std::mutex resource_mutex;
|
||||
void foo()
|
||||
void
|
||||
foo()
|
||||
{
|
||||
std::unique_lock<std::mutex> lk(resource_mutex);
|
||||
if(!resource_ptr)
|
||||
{
|
||||
resource_ptr.reset(new some_resource);
|
||||
}
|
||||
lk.unlock();
|
||||
resource_ptr->do_something();
|
||||
std::unique_lock<std::mutex> lk(resource_mutex);
|
||||
if (!resource_ptr) {
|
||||
resource_ptr.reset(new some_resource);
|
||||
}
|
||||
lk.unlock();
|
||||
resource_ptr->do_something();
|
||||
}
|
||||
|
||||
int main()
|
||||
int
|
||||
main()
|
||||
{
|
||||
foo();
|
||||
foo();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user