ACPI_INIT_GLOBAL(u8, acpi_gbl_abort_method, FALSE);
 ACPI_INIT_GLOBAL(u8, acpi_gbl_method_executing, FALSE);
+ACPI_INIT_GLOBAL(acpi_thread_id, acpi_gbl_db_thread_id, ACPI_INVALID_THREAD_ID);
 
 ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_ini_methods);
 ACPI_GLOBAL(u8, acpi_gbl_db_opt_no_region_support);
 
 
 #define ACPI_MUTEX_NOT_ACQUIRED         (acpi_thread_id) 0
 
+/* This Thread ID means an invalid thread ID */
+
+#ifdef ACPI_OS_INVALID_THREAD_ID
+#define ACPI_INVALID_THREAD_ID          ACPI_OS_INVALID_THREAD_ID
+#else
+#define ACPI_INVALID_THREAD_ID          ((acpi_thread_id) 0xFFFFFFFF)
+#endif
+
 /* Table for the global mutexes */
 
 struct acpi_mutex_info {
 
 
        for (i = 0; i < (num_threads); i++) {
                status =
-                   acpi_os_execute(OSL_DEBUGGER_THREAD, acpi_db_method_thread,
+                   acpi_os_execute(OSL_DEBUGGER_EXEC_THREAD,
+                                   acpi_db_method_thread,
                                    &acpi_gbl_db_method_info);
                if (ACPI_FAILURE(status)) {
                        break;
 
 
        ACPI_FUNCTION_ENTRY();
 
+#ifndef ACPI_APPLICATION
+       if (acpi_gbl_db_thread_id != acpi_os_get_thread_id()) {
+               return (AE_OK);
+       }
+#endif
+
        /* Check the abort flag */
 
        if (acpi_gbl_abort_method) {
                /* Create the debug execution thread to execute commands */
 
                acpi_gbl_db_threads_terminated = FALSE;
-               status = acpi_os_execute(OSL_DEBUGGER_THREAD,
+               status = acpi_os_execute(OSL_DEBUGGER_MAIN_THREAD,
                                         acpi_db_execute_thread, NULL);
                if (ACPI_FAILURE(status)) {
                        ACPI_EXCEPTION((AE_INFO, status,
                        acpi_gbl_db_threads_terminated = TRUE;
                        return_ACPI_STATUS(status);
                }
+       } else {
+               acpi_gbl_db_thread_id = acpi_os_get_thread_id();
        }
 
        return_ACPI_STATUS(AE_OK);
 }
 
 ACPI_EXPORT_SYMBOL(acpi_terminate_debugger)
+
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_set_debugger_thread_id
+ *
+ * PARAMETERS:  thread_id       - Debugger thread ID
+ *
+ * RETURN:      None
+ *
+ * DESCRIPTION: Set debugger thread ID
+ *
+ ******************************************************************************/
+void acpi_set_debugger_thread_id(acpi_thread_id thread_id)
+{
+       acpi_gbl_db_thread_id = thread_id;
+}
+
+ACPI_EXPORT_SYMBOL(acpi_set_debugger_thread_id)