current->state = TASK_INTERRUPTIBLE; schedule_timeout(1); 
schedule_timeout_interruptible(1); 
acpi_status acpi_os_wait_semaphore(acpi_handle handle, u32 units, u16 timeout){	acpi_status status = AE_OK;	struct semaphore *sem = (struct semaphore *)handle;	int ret = 0;	ACPI_FUNCTION_TRACE("os_wait_semaphore");	if (!sem || (units < 1))		return_ACPI_STATUS(AE_BAD_PARAMETER);	if (units > 1)		return_ACPI_STATUS(AE_SUPPORT);	ACPI_DEBUG_PRINT((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n",			  handle, units, timeout));	if (in_atomic())		timeout = 0;	switch (timeout) {		/*		 * No Wait:		 * --------		 * A zero timeout value indicates that we shouldn't wait - just		 * acquire the semaphore if available otherwise return AE_TIME		 * (a.k.a. 'would block').		 */	case 0:		if (down_trylock(sem))			status = AE_TIME;		break;		/*		 * Wait Indefinitely:		 * ------------------		 */	case ACPI_WAIT_FOREVER:		down(sem);		break;		/*		 * Wait w/ Timeout:		 * ----------------		 */	default:		// TODO: A better timeout algorithm?		{			int i = 0;			static const int quantum_ms = 1000 / HZ;			ret = down_trylock(sem);			for (i = timeout; (i > 0 && ret < 0); i -= quantum_ms) {				current->state = TASK_INTERRUPTIBLE;				schedule_timeout(1);				ret = down_trylock(sem);			}			if (ret != 0)				status = AE_TIME;		}		break;	}	if (ACPI_FAILURE(status)) {		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,				  "Failed to acquire semaphore[%p|%d|%d], %s\n",				  handle, units, timeout,				  acpi_format_exception(status)));	} else {		ACPI_DEBUG_PRINT((ACPI_DB_MUTEX,				  "Acquired semaphore[%p|%d|%d]\n", handle,				  units, timeout));	}	return_ACPI_STATUS(status);}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/01a527ec7c62efea601a39f0cd8e6a8517259014/osl.c/clean/drivers/acpi/osl.c