Example #1
0
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);
}
Example #2
0
void IORunLoop::step()
{
	IOAutoreleasePool *pool = IOAutoreleasePool::alloc()->init();
	kern_spinlock_lock(&_lock);

	processEventSources();

	kern_spinlock_unlock(&_lock);
	pool->release();
}
Example #3
0
IOObject *IOObject::retain()
{
	if(!this)
		return this;

	kern_spinlock_lock(&_lock);
	_retainCount ++;
	kern_spinlock_unlock(&_lock);
	
	return this;
}
Example #4
0
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);
}
Example #5
0
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);
	}
}
Example #6
0
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);
	}
}
Example #7
0
void IOObject::release()
{
	if(!this)
		return;

	kern_spinlock_lock(&_lock);

	if((-- _retainCount) == 0)
	{
		free();
		kfree(this);

		return;
	}

	kern_spinlock_unlock(&_lock);
}