这篇教程C++ CFRunLoopStop函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CFRunLoopStop函数的典型用法代码示例。如果您正苦于以下问题:C++ CFRunLoopStop函数的具体用法?C++ CFRunLoopStop怎么用?C++ CFRunLoopStop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CFRunLoopStop函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: hid_device_removal_callbackstatic 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,
示例2: CFRunLoopStopstatic 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,
示例3: CFRunLoopStopvoid HIDDevice::stop(void){ if ( cfRunLoop ) { CFRunLoopStop ( cfRunLoop ) ; Threads::Mutex::Lock stateLock ( runLoopMutex ) ; (*hidQueueInterface) -> stop ( hidQueueInterface ) ; stopDeviceThread ( ) ; }}
开发者ID:Doc-Ok,项目名称:OpticalTracking,代码行数:9,
示例4: sectask_server_requestkern_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,
示例5: timeout_cbstatic void timeout_cb(CFRunLoopTimerRef timer, void *context){ (void) timer; bool *timed_out = (bool *) context; *timed_out = true; CFRunLoopStop(CFRunLoopGetCurrent());}
开发者ID:GregMefford,项目名称:fwup,代码行数:9,
示例6: btpad_close_all_connectionsstatic 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,
示例7: _stream_handlerstatic 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,
示例8: output_callbackstatic 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,
示例9: lockervoid 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,
示例10: btpad_close_all_connectionsstatic 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,
示例11: pyfsevents_stopstatic 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,
示例12: fse_pipe_callbackstatic 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,
示例13: GotPacketstatic 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,
示例14: usb_cleanupvoid 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,
示例15: PsychHIDOSKbQueueReleasevoid 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,
示例16: console_user_changed_cbstatic voidconsole_user_changed_cb(SCDynamicStoreRef store, CFArrayRef changedKeys, void *context){ CFStringRef user; uid_t uid; gid_t gid; user = SCDynamicStoreCopyConsoleUser(store, &uid, &gid); if (user != NULL) { CFRelease(user); CFRunLoopStop(CFRunLoopGetCurrent()); }}
开发者ID:naota,项目名称:diskdev_cmds,代码行数:13,
示例17: memcpy/** * @brief input Called to add input data to the buffer * @param[in] id Report id * @param[in] data The data buffer * @param[in] len The report length */void pjrc_rawhid::input(uint8_t *data, CFIndex len){ if (!device_open) return; if (len > BUFFER_SIZE) len = BUFFER_SIZE; // Note: packet preprocessing done in OS independent code memcpy(buffer, &data[0], len); buffer_count = len; if (received_runloop) CFRunLoopStop(received_runloop);}
开发者ID:BangBo,项目名称:OpenPilot,代码行数:19,
示例18: SCNetworkReachabilityUnscheduleFromRunLoopvoid SCNetworkEventPublisher::stop() { if (run_loop_ == nullptr) { // No need to stop if there is not run loop. return; } for (const auto& target : targets_) { SCNetworkReachabilityUnscheduleFromRunLoop( target, run_loop_, kCFRunLoopDefaultMode); } CFRunLoopStop(run_loop_);}
开发者ID:folpindo,项目名称:osquery,代码行数:13,
示例19: detach_callbackstatic void detach_callback(void *context, IOReturn r, void *hid_mgr, IOHIDDeviceRef dev){ hid_t *p; printf("detach callback/n"); for (p = first_hid; p; p = p->next) { if (p->ref == dev) { p->open = 0; CFRunLoopStop(CFRunLoopGetCurrent()); return; } }}
开发者ID:samguns,项目名称:OpenPilot,代码行数:13,
示例20: key_stopintkey_stop(void){ if (eventTap == NULL) { warnx("tried to stop listening when not initialized"); return -1; } CFRunLoopStop(CFRunLoopGetCurrent()); CGEventTapEnable(eventTap, false); return 0;}
开发者ID:jpouellet,项目名称:cwjack,代码行数:13,
示例21: run_loop_lock void fsevents_monitor::on_stop() { lock_guard<mutex> run_loop_lock(run_mutex); if (!run_loop) throw libfsw_exception(_("run loop is null")); FSW_ELOG(_("Stopping event stream.../n")); FSEventStreamStop(stream); stream = nullptr; FSW_ELOG(_("Stopping run loop.../n")); CFRunLoopStop(run_loop); run_loop = nullptr; }
开发者ID:AntoineLee,项目名称:fswatch,代码行数:13,
示例22: CFRunLoopRemoveSourcevoid SystemEventsManager::stopLoop(bool forceStop) { if (systemEventLoopRunning && (forceStop || allEventsDisabled())) { CFRunLoopRemoveSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(notifyPortRef), kCFRunLoopCommonModes); IODeregisterForSystemPower(¬ifierObject); IOServiceClose(rootPort); IONotificationPortDestroy(notifyPortRef); CFRunLoopStop(CFRunLoopGetCurrent()); systemEventLoopRunning = false; }}
开发者ID:JUX84,项目名称:4d-plugin-system-events,代码行数:14,
示例23: signal_handlervoid signal_handler(int sig) { switch(sig) { case SIGHUP: if(!quiet) fprintf(stderr, "received SIGHUP signal, not supported/n"); CFRunLoopStop(CFRunLoopGetCurrent()); break; case SIGTERM: if(!quiet) fprintf(stderr, "received SIGTERM signal, terminating/n"); run = false; CFRunLoopStop(CFRunLoopGetCurrent()); break; case SIGINT: if(!quiet) fprintf(stderr, "received SIGINT signal, terminating/n"); run = false; CFRunLoopStop(CFRunLoopGetCurrent()); break; case SIGQUIT: if(!quiet) fprintf(stderr, "received SIGQUIT signal, terminating/n"); run = false; CFRunLoopStop(CFRunLoopGetCurrent()); break; default: fprintf(stderr, "uhandled signal (%d) %s/n", sig, strsignal(sig)); break; }}
开发者ID:Remiii,项目名称:mountblockd,代码行数:23,
示例24: Sys_Input_Shutdownvoid Sys_Input_Shutdown(struct input_data *input){ input->thread_shutdown = true; CFRunLoopStop(input->threadrunloop); pthread_join(input->thread, 0); pthread_mutex_destroy(&input->mouse_mutex); pthread_mutex_destroy(&input->key_mutex); pthread_mutex_destroy(&input->thread_mutex); pthread_cond_destroy(&input->thread_has_spawned); free(input);}
开发者ID:classicQ,项目名称:classicQ.github.io,代码行数:14,
示例25: LOGbool Activity::HandleActivityMessage(android::PMessage message) { if (message->GetWhat()==WhatActivityMessage::PAUSE_ACTIVITY || message->GetWhat()==WhatActivityMessage::PAUSE_ACTIVITY_FINISHING) { LOG("Preparing to exit..."); HandleActivityMessages(false); android::PMessage messageCopy=android::Message::Obtain(message); message->GetTarget()->SendMessage(messageCopy); android::Looper::MyLooper()->Quit(); CFRunLoopStop(CFRunLoopGetMain()); return true; } return false;}
开发者ID:DmitrySkiba,项目名称:itoa-main,代码行数:14,
示例26: disableCOSXScreen::~COSXScreen(){ disable(); m_events->adoptBuffer(NULL); m_events->removeHandler(CEvent::kSystem, m_events->getSystemTarget()); if (m_pmWatchThread) { // make sure the thread has setup the runloop. { CLock lock(m_pmMutex); while (!(bool)*m_pmThreadReady) { m_pmThreadReady->wait(); } } // now exit the thread's runloop and wait for it to exit LOG((CLOG_DEBUG "stopping watchSystemPowerThread")); CFRunLoopStop(m_pmRunloop); m_pmWatchThread->wait(); delete m_pmWatchThread; m_pmWatchThread = NULL; } delete m_pmThreadReady; delete m_pmMutex; m_events->removeHandler(m_events->forCOSXScreen().confirmSleep(), getEventTarget()); RemoveEventHandler(m_switchEventHandlerRef);#if defined(MAC_OS_X_VERSION_10_5) CGDisplayRemoveReconfigurationCallback(displayReconfigurationCallback, this);#else DMRemoveExtendedNotifyProc(m_displayManagerNotificationUPP, NULL, &m_PSN, 0); if (m_hiddenWindow) { ReleaseWindow(m_hiddenWindow); m_hiddenWindow = NULL; } if (m_userInputWindow) { ReleaseWindow(m_userInputWindow); m_userInputWindow = NULL; }#endif delete m_keyState; delete m_screensaver;}
开发者ID:rakete,项目名称:synergy-foss,代码行数:50,
示例27: lockvoid DiskArbitrationEventPublisher::stop() { if (run_loop_ == nullptr) { return; } WriteLock lock(mutex_); if (session_ != nullptr) { DASessionUnscheduleFromRunLoop(session_, run_loop_, kCFRunLoopDefaultMode); CFRelease(session_); session_ = nullptr; } CFRunLoopStop(run_loop_);}
开发者ID:PoppySeedPlehzr,项目名称:osquery,代码行数:14,
示例28: NotificationCallback/* Callback function which will recieve the 'mounted' notification * from FUSE. It is full with debug code... but I'll let it stay * that way. */static void NotificationCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) { if(DEBUGMODE) { char buffer[512]; LOG_DEBUG("Received notification:/n"); if(CFStringGetCString(name, buffer, 512, kCFStringEncodingUTF8) == true) LOG_DEBUG(" Name: %s/n", buffer); else LOG_DEBUG(" <Cound not get name>/n"); LOG_DEBUG(" userInfo:/n"); if(userInfo != NULL) CFDictionaryApplyFunction(userInfo, PrintDictEntry, NULL); else LOG_DEBUG(" <null>/n"); } if(userInfo != NULL) { // It's only null when testing const void *value = NULL; LOG_DEBUG("CFDictionaryGetValueIfPresent(%p, /"%s/", %p)/n", userInfo, FUSE_MOUNT_PATH_KEY, &value); if(CFDictionaryGetValueIfPresent(userInfo, CFSTR(FUSE_MOUNT_PATH_KEY), &value) == true) { LOG_DEBUG("CFStringGetTypeID(%p) == %lu ?/n", value, CFStringGetTypeID()); if(CFGetTypeID((CFStringRef)value) == CFStringGetTypeID()) { LOG_DEBUG(" yes./n"); LOG_DEBUG("mountPath=%p/n", mountPath); if(mountPath != NULL) CFRelease(mountPath); // No memory leaks please. LOG_DEBUG("assigning mountpath the value %p/n", value); mountPath = (CFStringRef)value; CFRetain(mountPath); LOG_DEBUG("done with assigning./n");#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 CFRunLoopStop(CFRunLoopGetCurrent());#endif } else LOG_DEBUG(" no."); } }}
开发者ID:GeekHades,项目名称:fuse_wait,代码行数:52,
示例29: interrupt_report_callback_funcstatic void interrupt_report_callback_func(void *target, IOReturn result, void *refcon, void *sender, UInt32 size)#endif{ hidreport_t rep = (hidreport_t) target; if (verbose && (rep->size_received != 0)) printf("Warning: previous report has not been read./n"); rep->size_received = size; CFRunLoopStop(CFRunLoopGetCurrent());}
开发者ID:Nimajamin,项目名称:pk2cmd,代码行数:15,
注:本文中的CFRunLoopStop函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CFSetGetCount函数代码示例 C++ CFRunLoopSourceSignal函数代码示例 |