示例#1
0
bool libmodbus_cpp::AbstractSlave::setAddress(uint8_t address)
{
    return (modbus_set_slave(getBackend()->getCtx(), address) != -1);
}
示例#2
0
 void Deallocate(void *Ptr) {
   const uptr BatchClassId = SizeClassMap::ClassID(sizeof(QuarantineBatch));
   getBackend().deallocatePrimary(Cache_, Ptr, BatchClassId);
 }
示例#3
0
文件: main.cpp 项目: imgntn/hifi

    void initialize(QWindow* window, gl::Context& initContext) {
        setObjectName("RenderThread");
        _context.setWindow(window);
        _context.create();
        _context.makeCurrent();
        window->setSurfaceType(QSurface::OpenGLSurface);
        _context.makeCurrent(_context.qglContext(), window);
#ifdef Q_OS_WIN
        wglSwapIntervalEXT(0);
#endif
        // GPU library init
        gpu::Context::init<gpu::gl::GLBackend>();
        _gpuContext = std::make_shared<gpu::Context>();
        _backend = _gpuContext->getBackend();
        _context.makeCurrent();
        DependencyManager::get<DeferredLightingEffect>()->init();
        _context.makeCurrent();
        initContext.create();
        _context.doneCurrent();
        std::unique_lock<std::mutex> lock(_mutex);
        Parent::initialize();
        _context.moveToThread(_thread);
    }

    void setup() override {
        RENDER_THREAD = QThread::currentThread();

        // Wait until the context has been moved to this thread
        {
示例#4
0
 // Internal quarantine allocation and deallocation functions. We first check
 // that the batches are indeed serviced by the Primary.
 // TODO(kostyak): figure out the best way to protect the batches.
 void *Allocate(uptr Size) {
   const uptr BatchClassId = SizeClassMap::ClassID(sizeof(QuarantineBatch));
   return getBackend().allocatePrimary(Cache_, BatchClassId);
 }