当前位置: 首页>>代码示例>>C++>>正文


C++ CFRunLoopStop函数代码示例

本文整理汇总了C++中CFRunLoopStop函数的典型用法代码示例。如果您正苦于以下问题:C++ CFRunLoopStop函数的具体用法?C++ CFRunLoopStop怎么用?C++ CFRunLoopStop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了CFRunLoopStop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: hid_device_removal_callback

static void hid_device_removal_callback(void *context, IOReturn result,
                                        void *sender)
{
	/* Stop the Run Loop for this device. */
	hid_device *d = context;

	d->disconnected = 1;
	CFRunLoopStop(d->run_loop);
}
开发者ID:Cloudhomebr,项目名称:node-openzwave,代码行数:9,代码来源:hid.c

示例2: CFRunLoopStop

static PyObject *pypowerobserver_stop(PyPowerObserver *self,
				      PyObject *args,
				      PyObject *kwargs)
{
    CFRunLoopStop(self->runLoop);

    Py_INCREF(Py_None);
    return Py_None;
}
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:9,代码来源:main.c

示例3: CFRunLoopStop

void HIDDevice::stop(void)
{
	if ( cfRunLoop ) {
		CFRunLoopStop ( cfRunLoop ) ;
		Threads::Mutex::Lock stateLock ( runLoopMutex ) ;
		(*hidQueueInterface) -> stop ( hidQueueInterface ) ;
		stopDeviceThread ( ) ;
	}
}
开发者ID:Doc-Ok,项目名称:OpticalTracking,代码行数:9,代码来源:HIDDevice.cpp

示例4: sectask_server_request

kern_return_t sectask_server_request(mach_port_t receiver,
        audit_token_t auditToken)
{
    memcpy(&g_self_audittoken, &auditToken, sizeof(g_self_audittoken));

    CFRunLoopStop(CFRunLoopGetCurrent());

    return 0;
}
开发者ID:darlinghq,项目名称:darling-security,代码行数:9,代码来源:sectask-10-sectask.c

示例5: timeout_cb

static void timeout_cb(CFRunLoopTimerRef timer, void *context)
{
    (void) timer;

    bool *timed_out = (bool *) context;
    *timed_out = true;

    CFRunLoopStop(CFRunLoopGetCurrent());
}
开发者ID:GregMefford,项目名称:fwup,代码行数:9,代码来源:mmc_osx.c

示例6: btpad_close_all_connections

static void btpad_close_all_connections(void)
{
   int i;
   for (i = 0; i < MAX_USERS; i ++)
      btpad_close_connection(&g_connections[i]);
   /* TODO/FIXME - create platform-agnostic solution for this
    * and figure out why/if this is needed. */
   CFRunLoopStop(CFRunLoopGetCurrent());
}
开发者ID:CautiousAlbino,项目名称:RetroArch,代码行数:9,代码来源:btpad.c

示例7: _stream_handler

static void
_stream_handler(ConstFSEventStreamRef stream,
                void *info,
                size_t numEvents,
                void *eventPaths,
                const FSEventStreamEventFlags eventFlags[],
                const FSEventStreamEventId eventIds[])
{
    const char **paths = eventPaths;
    streamobject *object = info;
    PyObject *result = NULL, *str = NULL, *num = NULL;

    assert(numEvents <= PY_SSIZE_T_MAX);

    PyGILState_STATE gil_state = PyGILState_Ensure();
    PyThreadState *thread_state = PyThreadState_Swap(object->state);

    /* Convert event data to Python objects */
    PyObject *event_paths = PyList_New(numEvents);
    if (!event_paths) {
        goto final;
    }

    PyObject *event_flags = PyList_New(numEvents);
    if (!event_flags) {
        goto final;
    }

    for (size_t i = 0; i < numEvents; i++) {
        str = PyBytes_FromString(paths[i]);
        #if PY_MAJOR_VERSION >= 3
            num = PyLong_FromLong(eventFlags[i]);
        #else
            num = PyInt_FromLong(eventFlags[i]);
        #endif
        if ((!num) || (!str)) {
            goto final;
        }
        PyList_SET_ITEM(event_paths, i, str);
        PyList_SET_ITEM(event_flags, i, num);
    }
    str = NULL;
    num = NULL;

    if ( (result = PyObject_CallFunctionObjArgs(
              object->callback, event_paths, event_flags, NULL)) == NULL) {
        /* May can return NULL if an exception is raised */
        if (!PyErr_Occurred())
            PyErr_SetString(PyExc_ValueError, callback_error_msg);

        /* Stop listening */
        CFRunLoopStop(object->loop);
    }

final:
开发者ID:poupas,项目名称:macfsevents,代码行数:55,代码来源:_fsevents.c

示例8: output_callback

static void output_callback(hid_t *context, IOReturn ret, void *sender, IOHIDReportType type, uint32_t id, uint8_t *data, CFIndex len)
{
    printf("output_callback, r=%d\n", ret);
    if (ret == kIOReturnSuccess) {
        *(int *)context = len;
    } else {
        // timeout if not success?
        *(int *)context = 0;
    }
    CFRunLoopStop(CFRunLoopGetCurrent());
}
开发者ID:samguns,项目名称:OpenPilot,代码行数:11,代码来源:pjrc_rawhid_mac.cpp

示例9: locker

void QFSEventsFileSystemWatcherEngine::stop()
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
    QMutexLocker locker(&mutex);
    stopFSStream(fsStream);
    if (threadsRunLoop) {
        CFRunLoopStop(threadsRunLoop);
        waitForStop.wait(&mutex);
    }
#endif
}
开发者ID:yinyunqiao,项目名称:qtbase,代码行数:11,代码来源:qfilesystemwatcher_fsevents.cpp

示例10: btpad_close_all_connections

static void btpad_close_all_connections(void)
{
   unsigned i;

   for (i = 0; i < MAX_USERS; i ++)
      btpad_close_connection(&g_connections[i]);

#ifdef __APPLE__
   CFRunLoopStop(CFRunLoopGetCurrent());
#endif
}
开发者ID:matthijsberk,项目名称:RetroArch,代码行数:11,代码来源:btstack_hid.c

示例11: pyfsevents_stop

static PyObject* pyfsevents_stop(PyObject* self, PyObject* thread) {
    PyObject* value = PyDict_GetItem(loops, thread);
    CFRunLoopRef loop = PyCObject_AsVoidPtr(value);

    /* stop runloop */
    if (loop) {
        CFRunLoopStop(loop);
    }

    Py_INCREF(Py_None);
    return Py_None;
}
开发者ID:poupas,项目名称:macfsevents_official,代码行数:12,代码来源:_fsevents.c

示例12: fse_pipe_callback

static void fse_pipe_callback(CFFileDescriptorRef fdref,
      CFOptionFlags callBackTypes, void *info)
{
  w_root_t *root = info;

  unused_parameter(fdref);
  unused_parameter(callBackTypes);
  unused_parameter(root);

  w_log(W_LOG_DBG, "pipe signalled\n");
  CFRunLoopStop(CFRunLoopGetCurrent());
}
开发者ID:kwlzn,项目名称:watchman,代码行数:12,代码来源:fsevents.c

示例13: GotPacket

static Boolean GotPacket(ConnectionRef conn, const PacketHeader *packet, void *refCon)
    // DoListen registers this routine with the connection abstraction layer 
    // so that it is called when a packet arrives.  For a description of the 
    // parameters, see the comments next to ConnectionCallbackProcPtr.
{
    #pragma unused(conn)
    Boolean         result;
    CFRunLoopRef    runLoop;
    
    // When we register this callback, we pass a reference to the runloop 
    // as the refCon.  Extract that reference here.
    
    runLoop = (CFRunLoopRef) refCon;
    assert(runLoop != NULL);
    assert( CFGetTypeID(runLoop) == CFRunLoopGetTypeID() );
    
    result = true;
    if (packet == NULL) {
        // Server connection has gone away.  No need to return false because 
        // the connection is torn anyway.
        
        CFRunLoopStop(runLoop);
    } else {
        // We got a packet from the server.  Tell the user about it.
        
        switch (packet->fType) {
            case kPacketTypeShout:
                if (packet->fSize != sizeof(PacketShout)) {
                    fprintf(stderr, "GotPacket: Server sent us a Shout with the wrong size (%" PRIu32 ").\n", packet->fSize);
                    result = false;
                }
                
                if (result && (packet->fID != kPacketIDNone) ) {
                    fprintf(stderr, "GotPacket: Server sent us a Shout with the wrong size (%" PRId32 ").\n", packet->fID);
                    result = false;
                }

                if (result) {
                    PacketShout * shoutPacket;
                    
                    shoutPacket = (PacketShout *) packet;
                    fprintf(stderr, "%*s heard \"%.*s\"\n", kResultColumnWidth, "", (int) sizeof(shoutPacket->fMessage), shoutPacket->fMessage);                
                }
                break;
            default:   
                fprintf(stderr, "GotPacket: Server sent us a packet with an unexpected type (%.4s).\n", (char *) &packet->fType);
                result = false;
                break;
        }
    }
    
    return result;
}
开发者ID:dark-saber,项目名称:public,代码行数:53,代码来源:Client.c

示例14: usb_cleanup

void usb_cleanup()
{
    DBG("usb_cleanup\n");
    close_usb_devices();
    if (currentRunLoop)
        CFRunLoopStop(currentRunLoop);

    if (notificationIterators != NULL) {
        free(notificationIterators);
        notificationIterators = NULL;
    }
}
开发者ID:BORGROMz,项目名称:android_system_core,代码行数:12,代码来源:usb_osx.c

示例15: PsychHIDOSKbQueueRelease

void PsychHIDOSKbQueueRelease(int deviceIndex)
{
    // Get true keyboardqueue index assigned to deviceIndex from original user provided deviceIndex:
    deviceIndex = PsychHIDOSGetKbQueueDevice(deviceIndex, NULL);

	// Keyboard queue for this deviceIndex already exists?
	if (NULL == psychHIDKbQueueFirstPress[deviceIndex]) {
		// No. Nothing to do then.
		return;
	}

	// Ok, we have a keyboard queue. Stop any operation on it first:
	PsychHIDOSKbQueueStop(deviceIndex);

    // The mutex will be automatically unlocked and destroyed by the CFRunLoop thread
    // so it isn't even declared in this routine
    if (psychHIDKbQueueCFRunLoopRef[deviceIndex]) {
        // Shutdown the processing thread for this queue:
        PsychLockMutex(&KbQueueMutex);

        // Stop the CFRunLoop, which will allow its associated thread to exit:
        CFRunLoopStop(psychHIDKbQueueCFRunLoopRef[deviceIndex]);

        // Done.
        PsychUnlockMutex(&KbQueueMutex);

        // Shutdown the thread, wait for its termination:
        PsychDeleteThread(&KbQueueThread[deviceIndex]);
        KbQueueThread[deviceIndex] = NULL;

        // Release the CFRunLoop for this queue:
        CFRelease(psychHIDKbQueueCFRunLoopRef[deviceIndex]);
        psychHIDKbQueueCFRunLoopRef[deviceIndex] = NULL;

        // Release queue object:
        CFRelease(queue[deviceIndex]);
        queue[deviceIndex] = NULL;
    }
    
	// Release its data structures:
	free(psychHIDKbQueueFirstPress[deviceIndex]); psychHIDKbQueueFirstPress[deviceIndex] = NULL;
	free(psychHIDKbQueueFirstRelease[deviceIndex]); psychHIDKbQueueFirstRelease[deviceIndex] = NULL;
	free(psychHIDKbQueueLastPress[deviceIndex]); psychHIDKbQueueLastPress[deviceIndex] = NULL;
	free(psychHIDKbQueueLastRelease[deviceIndex]); psychHIDKbQueueLastRelease[deviceIndex] = NULL;
	free(psychHIDKbQueueScanKeys[deviceIndex]); psychHIDKbQueueScanKeys[deviceIndex] = NULL;

	// Release kbqueue event buffer:
	PsychHIDDeleteEventBuffer(deviceIndex);

	// Done.
	return;
}
开发者ID:Orca25,项目名称:Psychtoolbox-3,代码行数:52,代码来源:PsychHIDStandardInterfaces.c


注:本文中的CFRunLoopStop函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。