Some refactoring in multithreading.
This commit is contained in:
16
src/GLBucket.cpp
Normal file
16
src/GLBucket.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "GLBucket.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
std::unique_ptr<GLBucket> GLBucket::s_instance = std::unique_ptr<GLBucket>(new GLBucket);
|
||||
|
||||
GLBucket &GLBucket::instance()
|
||||
{
|
||||
return *s_instance.get();
|
||||
}
|
||||
|
||||
void GLBucket::runGlCall(const std::function<void(void)> &f)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
f();
|
||||
}
|
||||
Reference in New Issue
Block a user