Exemplo n.º 1
0
bool libmodbus_cpp::AbstractSlave::setAddress(uint8_t address)
{
    return (modbus_set_slave(getBackend()->getCtx(), address) != -1);
}
Exemplo n.º 2
0
 void Deallocate(void *Ptr) {
   const uptr BatchClassId = SizeClassMap::ClassID(sizeof(QuarantineBatch));
   getBackend().deallocatePrimary(Cache_, Ptr, BatchClassId);
 }
Exemplo n.º 3
0
Arquivo: main.cpp Projeto: 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
        {
Exemplo n.º 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);
 }