thread_t kern_threadCreate(thread_entry_t entry, void *arg) { kern_spinlock_t test = 0; kern_spinlock_lock(&test); return __io_threadCreate((void *)entry, arg, arg); }
void IORunLoop::step() { IOAutoreleasePool *pool = IOAutoreleasePool::alloc()->init(); kern_spinlock_lock(&_lock); processEventSources(); kern_spinlock_unlock(&_lock); pool->release(); }
IOObject *IOObject::retain() { if(!this) return this; kern_spinlock_lock(&_lock); _retainCount ++; kern_spinlock_unlock(&_lock); return this; }
void PCIProvider::requestProbe() { kern_spinlock_lock(&_lock); for(int bus=0; bus<256; bus++) { for(int device=0; device<32; device++) { checkDevice(bus, device); } } _firstRun = false; kern_spinlock_unlock(&_lock); }
void IORunLoop::removeEventSource(IOEventSource *eventSource) { if(isOnThread()) { _removedSources->addObject(eventSource); } else { kern_spinlock_lock(&_lock); eventSource->setRunLoop(0); _eventSources->removeObject(eventSource); kern_spinlock_unlock(&_lock); } }
void IORunLoop::addEventSource(IOEventSource *eventSource) { if(isOnThread()) { _eventSources->addObject(eventSource); eventSource->setRunLoop(this); } else { kern_spinlock_lock(&_lock); _eventSources->addObject(eventSource); eventSource->setRunLoop(this); kern_spinlock_unlock(&_lock); } }
void IOObject::release() { if(!this) return; kern_spinlock_lock(&_lock); if((-- _retainCount) == 0) { free(); kfree(this); return; } kern_spinlock_unlock(&_lock); }