这篇教程C++ CFRunLoopSourceSignal函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CFRunLoopSourceSignal函数的典型用法代码示例。如果您正苦于以下问题:C++ CFRunLoopSourceSignal函数的具体用法?C++ CFRunLoopSourceSignal怎么用?C++ CFRunLoopSourceSignal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CFRunLoopSourceSignal函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: AddToMessageQueuevoid AddToMessageQueue(CFTypeRef objectToAdd){ int pthreadError; // take the lock on the message queue pthreadError = pthread_mutex_lock(&queueLock); if (pthreadError) {#if DEBUG printf("AddToMessageQueue: pthread_mutex_lock failed (%d)/n", pthreadError);#endif return; } // add the object to the queue CFArrayAppendValue(queueArray, objectToAdd); // release the lock pthreadError = pthread_mutex_unlock(&queueLock); if (pthreadError) {#if DEBUG printf("AddToMessageQueue: pthread_mutex_unlock failed (%d)/n", pthreadError);#endif return; } // signal the run loop source, so it runs CFRunLoopSourceSignal(runLoopSource); // and make sure the run loop wakes up right away (otherwise it may take a few seconds) CFRunLoopWakeUp(mainThreadRunLoop);}
开发者ID:AmesianX,项目名称:MIDIApps,代码行数:30,
示例2: lockervoid WatcherThread::stop(){ MutexLocker locker(&mutex); flags |= Stop; CFRunLoopSourceSignal(source); CFRunLoopWakeUp(loop);}
开发者ID:Andersbakken,项目名称:rtags-old-branches,代码行数:7,
示例3: rlsCallbackstatic voidrlsCallback(CFMachPortRef port, void *msg, CFIndex size, void *info){ mach_no_senders_notification_t *buf = msg; mach_msg_id_t msgid = buf->not_header.msgh_id; SCDynamicStoreRef store = (SCDynamicStoreRef)info; SCDynamicStorePrivateRef storePrivate = (SCDynamicStorePrivateRef)store; if (msgid == MACH_NOTIFY_NO_SENDERS) { /* the server died, disable additional callbacks */#ifdef DEBUG SCLog(_sc_verbose, LOG_INFO, CFSTR(" rlsCallback(), notifier port closed"));#endif /* DEBUG */#ifdef DEBUG if (port != storePrivate->rlsNotifyPort) { SCLog(_sc_verbose, LOG_DEBUG, CFSTR("rlsCallback(), why is port != rlsNotifyPort?")); }#endif /* DEBUG */ /* re-establish notification and inform the client */ (void)__SCDynamicStoreReconnectNotifications(store); } /* signal the real runloop source */ if (storePrivate->rls != NULL) { CFRunLoopSourceSignal(storePrivate->rls); } return;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:30,
示例4: while/* * rend_pipe_monitor */void *rend_pipe_monitor(void* arg) { fd_set rset; int result; while(1) { DPRINTF(E_DBG,L_REND,"Waiting for data/n"); FD_ZERO(&rset); FD_SET(rend_pipe_to[RD_SIDE],&rset); /* sit in a select spin until there is data on the to fd */ while(((result=select(rend_pipe_to[RD_SIDE] + 1,&rset,NULL,NULL,NULL)) != -1) && errno != EINTR) { if(FD_ISSET(rend_pipe_to[RD_SIDE],&rset)) { DPRINTF(E_DBG,L_REND,"Received a message from daap server/n"); CFRunLoopSourceSignal(rend_rls); CFRunLoopWakeUp(rend_runloop); sleep(1); /* force a reschedule, hopefully */ } } DPRINTF(E_DBG,L_REND,"Select error!/n"); /* should really bail here */ }}
开发者ID:jameshilliard,项目名称:WECB-BH-GPL,代码行数:28,
示例5: CFRunLoopSourceSignalvoid wxApp::WakeUpIdle(){#ifdef __WXMAC_OSX__ if (m_macEventPosted) { CFRunLoopSourceSignal(m_macEventPosted); }#endif wxMacWakeUp() ;}
开发者ID:gitrider,项目名称:wxsj2,代码行数:10,
示例6: CFSocketDispatchWriteEventstatic voidCFSocketDispatchWriteEvent(void* p){ CFSocketRef socket = (CFSocketRef) p; CFRunLoopSourceRef src = socket->_source; socket->_writeFired = true; if (src != NULL) CFRunLoopSourceSignal(src);}
开发者ID:1053948334,项目名称:myos.frameworks,代码行数:11,
示例7: lvoid HostDnsServiceDarwin::monitorThreadShutdown(){ ALock l(this); if (!m->m_fStop) { CFRunLoopSourceSignal(m->m_Stopper); CFRunLoopWakeUp(m->m_RunLoopRef); RTSemEventWait(m->m_evtStop, RT_INDEFINITE_WAIT); }}
开发者ID:mcenirm,项目名称:vbox,代码行数:11,
示例8: Tcl_AlertNotifiervoidTcl_AlertNotifier( ClientData clientData){ ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData; LOCK_NOTIFIER; if (tsdPtr->runLoop) { tsdPtr->eventReady = 1; CFRunLoopSourceSignal(tsdPtr->runLoopSource); CFRunLoopWakeUp(tsdPtr->runLoop); } UNLOCK_NOTIFIER;}
开发者ID:aosm,项目名称:tcl,代码行数:14,
示例9: hid_removal_callbackstatic void hid_removal_callback(void *ctx, IOReturn result, void *sender){ _HS_UNUSED(result); _HS_UNUSED(sender); hs_port *port = ctx; pthread_mutex_lock(&port->u.hid->mutex); port->u.hid->device_removed = true; CFRunLoopSourceSignal(port->u.hid->shutdown_source); pthread_mutex_unlock(&port->u.hid->mutex); fire_device_event(port);}
开发者ID:Koromix,项目名称:ty,代码行数:14,
示例10: btstack_set_poweronvoid btstack_set_poweron(bool on){ if (!btstack_try_load()) return; if (on && !btstack_thread) pthread_create(&btstack_thread, 0, btstack_thread_func, 0); else if (!on && btstack_thread && btstack_quit_source) { CFRunLoopSourceSignal(btstack_quit_source); pthread_join(btstack_thread, 0); btstack_thread = 0; }}
开发者ID:Mbcpro,项目名称:RetroArch,代码行数:14,
示例11: DAStageSignalvoid DAStageSignal( void ){ /* * Signal DAStage. */ if ( gDAIdle ) { ___vproc_transaction_begin( ); } gDAIdle = FALSE; CFRunLoopSourceSignal( __gDAStageRunLoopSource );}
开发者ID:alexzhang2015,项目名称:osx-10.9,代码行数:15,
示例12: btstack_set_poweronstatic void btstack_set_poweron(bool on){ if (!btstack_try_load()) return; if (on && !btstack_thread) btstack_thread = sthread_create(btstack_thread_func, NULL); else if (!on && btstack_thread && btstack_quit_source) {#ifdef __APPLE__ CFRunLoopSourceSignal(btstack_quit_source);#endif sthread_join(btstack_thread); btstack_thread = NULL; }}
开发者ID:matthijsberk,项目名称:RetroArch,代码行数:16,
示例13: PushExitCommandvoid DeviceManagerThread::Shutdown(){ // Push for thread shutdown *WITH NO WAIT*. // This will have the following effect: // - Exit command will get enqueued, which will be executed later on the thread itself. // - Beyond this point, this DeviceManager object may be deleted by our caller. // - Other commands, such as CreateDevice, may execute before ExitCommand, but they will // fail gracefully due to pLock->pManager == 0. Future commands can't be enqued // after pManager is null. // - Once ExitCommand executes, ThreadCommand::Run loop will exit and release the last // reference to the thread object. PushExitCommand(false); // make sure CFRunLoopRunInMode is woken up CFRunLoopSourceSignal(CommandQueueSource); CFRunLoopWakeUp(RunLoop);}
开发者ID:123woodman,项目名称:minko,代码行数:17,
示例14: hid_closevoid HID_API_EXPORT hid_close(hid_device *dev){ if ( !dev ) { return; } /* Disconnect the report callback before close. */ if (!dev->disconnected) { IOHIDDeviceRegisterInputReportCallback( dev->device_handle, dev->input_report_buf, dev->max_input_report_len, NULL, dev); IOHIDManagerRegisterDeviceRemovalCallback(hid_mgr, NULL, dev); IOHIDDeviceUnscheduleFromRunLoop(dev->device_handle, dev->run_loop, dev->run_loop_mode); IOHIDDeviceScheduleWithRunLoop(dev->device_handle, CFRunLoopGetMain(), kCFRunLoopDefaultMode); } /* Cause read_thread() to stop. */ dev->shutdown_thread = 1; /* Wake up the run thread's event loop so that the thread can exit. */ CFRunLoopSourceSignal(dev->source); CFRunLoopWakeUp(dev->run_loop); /* Notify the read thread that it can shut down now. */ pthread_barrier_wait(&dev->shutdown_barrier); /* Wait for read_thread() to end. */ pthread_join(dev->thread, NULL); /* Close the OS handle to the device, but only if it's not been unplugged. If it's been unplugged, then calling IOHIDDeviceClose() will crash. */ if (!dev->disconnected) { IOHIDDeviceClose(dev->device_handle, kIOHIDOptionsTypeNone); } /* Clear out the queue of received reports. */ pthread_mutex_lock(&dev->mutex); while (dev->input_reports) { return_data(dev, NULL, 0); } pthread_mutex_unlock(&dev->mutex); free_hid_device(dev);}
开发者ID:jingoro2112,项目名称:dna,代码行数:46,
示例15: fxQueuePromiseJobsvoid fxQueuePromiseJobs(txMachine* the){#if mxMacOSX CFRunLoopSourceContext context;#endif txJob* job = malloc(sizeof(txJob)); job->the = the; job->moduleID = XS_NO_ID;#if mxMacOSX memset(&context, 0, sizeof(context)); context.info = job; context.perform = fxPerformJob; job->source = CFRunLoopSourceCreate(kCFAllocatorDefault, 0, &context); CFRunLoopAddSource(CFRunLoopGetCurrent(), job->source, gxRunLoopMode); CFRunLoopSourceSignal(job->source);#endif}
开发者ID:kouis3940,项目名称:kinomajs,代码行数:17,
示例16: FOREACHInputHandler_MacOSX_HID::~InputHandler_MacOSX_HID(){ FOREACH( HIDDevice *, m_vDevices, i ) delete *i; if( PREFSMAN->m_bThreadedInput ) { CFRunLoopSourceSignal( m_SourceRef ); CFRunLoopWakeUp( m_LoopRef ); m_InputThread.Wait(); CFRelease( m_SourceRef ); CFRelease( m_LoopRef ); LOG->Trace( "Input handler thread shut down." ); } FOREACH( io_iterator_t, m_vIters, i ) IOObjectRelease( *i ); IONotificationPortDestroy( m_NotifyPort );}
开发者ID:AratnitY,项目名称:stepmania,代码行数:18,
示例17: mailstream_low_cfstream_cancelstatic void mailstream_low_cfstream_cancel(mailstream_low * s){#if HAVE_CFNETWORK struct mailstream_cfstream_data * cfstream_data; cfstream_data = (struct mailstream_cfstream_data *) s->data; pthread_mutex_lock(&cfstream_data->runloop_lock); if (cfstream_data->cancelSource != NULL) { CFRunLoopSourceSignal(cfstream_data->cancelSource); } if (cfstream_data->runloop != NULL) { CFRunLoopWakeUp(cfstream_data->runloop); } pthread_mutex_unlock(&cfstream_data->runloop_lock);#endif}
开发者ID:AlexandrPonomarev,项目名称:Gmail,代码行数:19,
示例18: uv__cf_loop_signalvoid uv__cf_loop_signal(uv_loop_t* loop, cf_loop_signal_cb cb, void* arg) { uv__cf_loop_signal_t* item; item = malloc(sizeof(*item)); /* XXX: Fail */ if (item == NULL) abort(); item->arg = arg; item->cb = cb; uv_mutex_lock(&loop->cf_mutex); QUEUE_INSERT_TAIL(&loop->cf_signals, &item->member); uv_mutex_unlock(&loop->cf_mutex); assert(loop->cf_loop != NULL); CFRunLoopSourceSignal(loop->cf_cb); CFRunLoopWakeUp(loop->cf_loop);}
开发者ID:1GHL,项目名称:learn_libuv,代码行数:19,
示例19: mailstream_cfstream_interrupt_idlevoid mailstream_cfstream_interrupt_idle(mailstream * s){#if HAVE_CFNETWORK struct mailstream_cfstream_data * cfstream_data; cfstream_data = (struct mailstream_cfstream_data *) s->low->data; pthread_mutex_lock(&cfstream_data->runloop_lock); if (cfstream_data->idleInterruptedSource != NULL) { CFRunLoopSourceSignal(cfstream_data->idleInterruptedSource); } if (cfstream_data->runloop != NULL) { CFRunLoopWakeUp(cfstream_data->runloop); } pthread_mutex_unlock(&cfstream_data->runloop_lock);#endif}
开发者ID:CaptainPopetastic,项目名称:libetpan,代码行数:19,
示例20: _kextmanager_user_did_log_in/******************************************************************************** This function is executed in the main thread after its run loop gets* kicked by a client request.*******************************************************************************/kern_return_t _kextmanager_user_did_log_in( mach_port_t server, int euid, AuthorizationExternalForm authref){ kern_return_t result = KERN_SUCCESS; logged_in_uid = euid;#ifndef NO_CFUserNotification CFRunLoopSourceSignal(gNotificationQueueRunLoopSource); CFRunLoopWakeUp(gMainRunLoop);#endif NO_CFUserNotification//finish: gClientUID = -1; return result;}
开发者ID:OpenDarwin-CVS,项目名称:SEDarwin,代码行数:24,
示例21: kextd_handle_finished_notificationvoid kextd_handle_finished_notification(CFUserNotificationRef userNotification, CFOptionFlags responseFlags){ if (gCurrentNotification) { CFRelease(gCurrentNotification); gCurrentNotification = NULL; } if (gCurrentNotificationRunLoopSource) { CFRunLoopRemoveSource(gMainRunLoop, gCurrentNotificationRunLoopSource, kCFRunLoopDefaultMode); CFRelease(gCurrentNotificationRunLoopSource); gCurrentNotificationRunLoopSource = NULL; } CFRunLoopSourceSignal(gNotificationQueueRunLoopSource); CFRunLoopWakeUp(gMainRunLoop); return;}
开发者ID:OpenDarwin-CVS,项目名称:SEDarwin,代码行数:21,
示例22: _kextmanager_record_nonsecure_kextloadkern_return_t _kextmanager_record_nonsecure_kextload( mach_port_t server, char * load_data, int load_data_length){ kern_return_t result = KERN_SUCCESS;#ifndef NO_CFUserNotification CFStringRef kextPath = NULL; // must release kextPath = CFStringCreateWithCString(kCFAllocatorDefault, load_data, kCFStringEncodingMacRoman); if (!kextPath) { result = KERN_FAILURE; goto finish; } if (!CFDictionaryGetValue(gNotifiedNonsecureKextPaths, kextPath)) { CFArrayAppendValue(gPendedNonsecureKextPaths, kextPath); CFDictionarySetValue(gNotifiedNonsecureKextPaths, kextPath, kCFBooleanTrue); } if (logged_in_uid != -1) { CFRunLoopSourceSignal(gNotificationQueueRunLoopSource); CFRunLoopWakeUp(gMainRunLoop); }#else result = KERN_FAILURE;#endif /* NO_CFUserNotification */finish:#ifndef NO_CFUserNotification if (kextPath) CFRelease(kextPath);#endif /* NO_CFUserNotification */ gClientUID = -1; return result;}
开发者ID:OpenDarwin-CVS,项目名称:SEDarwin,代码行数:40,
示例23: stopvoidstop(CFRunLoopSourceRef stopRls){ // cleanup if (storeRls != NULL) { CFRunLoopSourceInvalidate(storeRls); CFRelease(storeRls); storeRls = NULL; } if (store != NULL) { CFRelease(store); store = NULL; CFRelease(curGlobals); CFRelease(curConfigFile); CFRelease(curDefaults); CFRelease(curStartup); } CFRunLoopSourceSignal(stopRls); return;}
开发者ID:unofficial-opensource-apple,项目名称:configd_plugins,代码行数:23,
注:本文中的CFRunLoopSourceSignal函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CFRunLoopStop函数代码示例 C++ CFRunLoopRunInMode函数代码示例 |