Changes in / [875c629:bf75e3cb] in mainline
- Location:
- kernel/generic
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/debug.h
r875c629 rbf75e3cb 55 55 do { \ 56 56 if (!(expr)) \ 57 panic_assert("%s() at %s:%u:\n%s", \ 58 __func__, __FILE__, __LINE__, #expr); \ 57 panic_assert("%s", #expr); \ 59 58 } while (0) 60 59 … … 73 72 do { \ 74 73 if (!(expr)) \ 75 panic_assert("%s() at %s:%u:\n%s, %s", \ 76 __func__, __FILE__, __LINE__, #expr, msg); \ 74 panic_assert("%s, %s", #expr, msg); \ 77 75 } while (0) 78 76 -
kernel/generic/include/proc/thread.h
r875c629 rbf75e3cb 91 91 92 92 /** Function implementing the thread. */ 93 void (* thread_code)(void *);93 void (* thread_code)(void *); 94 94 /** Argument passed to thread_code() function. */ 95 95 void *thread_arg; 96 96 97 97 /** 98 * From here, the stored context is restored 99 * when the thread isscheduled.98 * From here, the stored context is restored when the thread is 99 * scheduled. 100 100 */ 101 101 context_t saved_context; 102 103 /** 104 * From here, the stored timeout context 105 * is restored when sleep times out. 102 /** 103 * From here, the stored timeout context is restored when sleep times 104 * out. 106 105 */ 107 106 context_t sleep_timeout_context; 108 109 /** 110 * From here, the stored interruption context 111 * is restored when sleep is interrupted. 107 /** 108 * From here, the stored interruption context is restored when sleep is 109 * interrupted. 112 110 */ 113 111 context_t sleep_interruption_context; … … 127 125 */ 128 126 bool in_copy_from_uspace; 129 130 127 /** 131 128 * True if this thread is executing copy_to_uspace(). … … 190 187 191 188 #ifdef CONFIG_UDEBUG 192 /**193 * If true, the scheduler will print a stack trace194 * to the kernel console upon scheduling this thread.195 */196 bool btrace;197 198 189 /** Debugging stuff */ 199 190 udebug_thread_t udebug; … … 246 237 extern bool thread_exists(thread_t *); 247 238 248 #ifdef CONFIG_UDEBUG249 extern void thread_stack_trace(thread_id_t);250 #endif251 252 239 /** Fpu context slab cache. */ 253 240 extern slab_cache_t *fpu_context_slab; -
kernel/generic/src/console/cmd.c
r875c629 rbf75e3cb 78 78 static cmd_info_t help_info = { 79 79 .name = "help", 80 .description = "List supported commands.",80 .description = "List of supported commands.", 81 81 .func = cmd_help, 82 82 .argc = 0 83 83 }; 84 84 85 /* Data and methods for 'reboot' command. */86 85 static int cmd_reboot(cmd_arg_t *argv); 87 86 static cmd_info_t reboot_info = { 88 87 .name = "reboot", 89 .description = "Reboot system.",88 .description = "Reboot.", 90 89 .func = cmd_reboot, 91 90 .argc = 0 92 91 }; 93 92 94 /* Data and methods for 'uptime' command. */95 93 static int cmd_uptime(cmd_arg_t *argv); 96 94 static cmd_info_t uptime_info = { 97 95 .name = "uptime", 98 .description = " Show system uptime.",96 .description = "Print uptime information.", 99 97 .func = cmd_uptime, 100 98 .argc = 0 101 99 }; 102 100 103 /* Data and methods for 'continue' command. */104 101 static int cmd_continue(cmd_arg_t *argv); 105 102 static cmd_info_t continue_info = { … … 111 108 112 109 #ifdef CONFIG_TEST 113 114 /* Data and methods for 'test' command. */115 110 static char test_buf[MAX_CMDLINE + 1]; 116 111 static int cmd_test(cmd_arg_t *argv); … … 124 119 static cmd_info_t test_info = { 125 120 .name = "test", 126 .description = " <test> Listkernel tests or run a test.",121 .description = "Print list of kernel tests or run a test.", 127 122 .func = cmd_test, 128 123 .argc = 1, … … 130 125 }; 131 126 132 /* Data and methods for 'bench' command. */133 127 static int cmd_bench(cmd_arg_t *argv); 134 128 static cmd_arg_t bench_argv[] = { … … 144 138 static cmd_info_t bench_info = { 145 139 .name = "bench", 146 .description = " <test> <count>Run kernel test as benchmark.",140 .description = "Run kernel test as benchmark.", 147 141 .func = cmd_bench, 148 142 .argc = 2, 149 143 .argv = bench_argv 150 144 }; 151 152 #endif /* CONFIG_TEST */ 145 #endif 153 146 154 147 /* Data and methods for 'description' command. */ 155 148 static int cmd_desc(cmd_arg_t *argv); 156 149 static void desc_help(void); 157 static char desc_buf[MAX_CMDLINE +1];150 static char desc_buf[MAX_CMDLINE+1]; 158 151 static cmd_arg_t desc_argv = { 159 152 .type = ARG_TYPE_STRING, … … 163 156 static cmd_info_t desc_info = { 164 157 .name = "describe", 165 .description = " <command>Describe specified command.",158 .description = "Describe specified command.", 166 159 .help = desc_help, 167 160 .func = cmd_desc, … … 172 165 /* Data and methods for 'symaddr' command. */ 173 166 static int cmd_symaddr(cmd_arg_t *argv); 174 static char symaddr_buf[MAX_CMDLINE +1];167 static char symaddr_buf[MAX_CMDLINE+1]; 175 168 static cmd_arg_t symaddr_argv = { 176 169 .type = ARG_TYPE_STRING, … … 180 173 static cmd_info_t symaddr_info = { 181 174 .name = "symaddr", 182 .description = " <symbol>Return symbol address.",175 .description = "Return symbol address.", 183 176 .func = cmd_symaddr, 184 177 .argc = 1, … … 186 179 }; 187 180 188 /* Data and methods for 'set4' command. */ 189 static char set_buf[MAX_CMDLINE + 1]; 181 static char set_buf[MAX_CMDLINE+1]; 190 182 static int cmd_set4(cmd_arg_t *argv); 191 183 static cmd_arg_t set4_argv[] = { … … 201 193 static cmd_info_t set4_info = { 202 194 .name = "set4", 203 .description = " <addr> <value> Set 4B memory location to a value.",195 .description = "set <dest_addr> <value> - 4byte version", 204 196 .func = cmd_set4, 205 197 .argc = 2, … … 221 213 static cmd_info_t call0_info = { 222 214 .name = "call0", 223 .description = " <function> Call function().",215 .description = "call0 <function> -> call function().", 224 216 .func = cmd_call0, 225 217 .argc = 1, … … 236 228 static cmd_info_t mcall0_info = { 237 229 .name = "mcall0", 238 .description = " <function> Call function() on each CPU.",230 .description = "mcall0 <function> -> call function() on each CPU.", 239 231 .func = cmd_mcall0, 240 232 .argc = 1, … … 258 250 static cmd_info_t call1_info = { 259 251 .name = "call1", 260 .description = " <function> <arg1> Call function(arg1).",252 .description = "call1 <function> <arg1> -> call function(arg1).", 261 253 .func = cmd_call1, 262 254 .argc = 2, … … 285 277 static cmd_info_t call2_info = { 286 278 .name = "call2", 287 .description = " <function> <arg1> <arg2> Call function(arg1,arg2).",279 .description = "call2 <function> <arg1> <arg2> -> call function(arg1,arg2).", 288 280 .func = cmd_call2, 289 281 .argc = 3, … … 318 310 static cmd_info_t call3_info = { 319 311 .name = "call3", 320 .description = " <function> <arg1> <arg2> <arg3> Call function(arg1, arg2,arg3).",312 .description = "call3 <function> <arg1> <arg2> <arg3> -> call function(arg1,arg2,arg3).", 321 313 .func = cmd_call3, 322 314 .argc = 4, … … 348 340 cmd_info_t tlb_info = { 349 341 .name = "tlb", 350 .description = "Print TLB of the current CPU.",342 .description = "Print TLB of current processor.", 351 343 .help = NULL, 352 344 .func = cmd_tlb, … … 385 377 }; 386 378 387 #ifdef CONFIG_UDEBUG388 389 /* Data and methods for 'btrace' command */390 static int cmd_btrace(cmd_arg_t *argv);391 static cmd_arg_t btrace_argv = {392 .type = ARG_TYPE_INT,393 };394 static cmd_info_t btrace_info = {395 .name = "btrace",396 .description = "<threadid> Show thread stack trace.",397 .func = cmd_btrace,398 .argc = 1,399 .argv = &btrace_argv400 };401 402 #endif /* CONFIG_UDEBUG */403 379 404 380 static int cmd_sched(cmd_arg_t *argv); 405 381 static cmd_info_t sched_info = { 406 382 .name = "scheduler", 407 .description = " Showscheduler information.",383 .description = "List all scheduler information.", 408 384 .func = cmd_sched, 409 385 .argc = 0 … … 430 406 static cmd_info_t zones_info = { 431 407 .name = "zones", 432 .description = "List memory zones.",408 .description = "List of memory zones.", 433 409 .func = cmd_zones, 434 410 .argc = 0 411 }; 412 413 /* Data and methods for 'ipc' command */ 414 static int cmd_ipc(cmd_arg_t *argv); 415 static cmd_arg_t ipc_argv = { 416 .type = ARG_TYPE_INT, 417 }; 418 static cmd_info_t ipc_info = { 419 .name = "ipc", 420 .description = "ipc <taskid> Show IPC information of given task.", 421 .func = cmd_ipc, 422 .argc = 1, 423 .argv = &ipc_argv 424 }; 425 426 /* Data and methods for 'kill' command */ 427 static int cmd_kill(cmd_arg_t *argv); 428 static cmd_arg_t kill_argv = { 429 .type = ARG_TYPE_INT, 430 }; 431 static cmd_info_t kill_info = { 432 .name = "kill", 433 .description = "kill <taskid> Kill a task.", 434 .func = cmd_kill, 435 .argc = 1, 436 .argv = &kill_argv 435 437 }; 436 438 … … 443 445 static cmd_info_t zone_info = { 444 446 .name = "zone", 445 .description = " <zone>Show memory zone structure.",447 .description = "Show memory zone structure.", 446 448 .func = cmd_zone, 447 449 .argc = 1, 448 450 .argv = &zone_argv 449 };450 451 /* Data and methods for 'ipc' command */452 static int cmd_ipc(cmd_arg_t *argv);453 static cmd_arg_t ipc_argv = {454 .type = ARG_TYPE_INT,455 };456 static cmd_info_t ipc_info = {457 .name = "ipc",458 .description = "<taskid> Show IPC information of a task.",459 .func = cmd_ipc,460 .argc = 1,461 .argv = &ipc_argv462 };463 464 /* Data and methods for 'kill' command */465 static int cmd_kill(cmd_arg_t *argv);466 static cmd_arg_t kill_argv = {467 .type = ARG_TYPE_INT,468 };469 static cmd_info_t kill_info = {470 .name = "kill",471 .description = "<taskid> Kill a task.",472 .func = cmd_kill,473 .argc = 1,474 .argv = &kill_argv475 451 }; 476 452 … … 506 482 &cpus_info, 507 483 &desc_info, 484 &reboot_info, 485 &uptime_info, 508 486 &halt_info, 509 487 &help_info, 510 488 &ipc_info, 511 489 &kill_info, 512 &physmem_info,513 &reboot_info,514 &sched_info,515 490 &set4_info, 516 491 &slabs_info, 492 &sysinfo_info, 517 493 &symaddr_info, 518 &sysinfo_info, 494 &sched_info, 495 &threads_info, 519 496 &tasks_info, 520 & threads_info,497 &physmem_info, 521 498 &tlb_info, 522 &uptime_info,523 499 &version_info, 524 500 &zones_info, … … 528 504 &bench_info, 529 505 #endif 530 #ifdef CONFIG_UDEBUG531 &btrace_info,532 #endif533 506 NULL 534 507 }; … … 557 530 } 558 531 } 532 559 533 560 534 /** List supported commands. … … 600 574 } 601 575 576 602 577 /** Reboot the system. 603 578 * … … 613 588 return 1; 614 589 } 590 615 591 616 592 /** Print system uptime information. … … 848 824 } 849 825 826 850 827 /** Print detailed description of 'describe' command. */ 851 828 void desc_help(void) … … 934 911 * @return Always 1 935 912 */ 936 int cmd_slabs(cmd_arg_t * argv)913 int cmd_slabs(cmd_arg_t * argv) 937 914 { 938 915 slab_print_list(); … … 946 923 * @return Always 1 947 924 */ 948 int cmd_sysinfo(cmd_arg_t * argv)925 int cmd_sysinfo(cmd_arg_t * argv) 949 926 { 950 927 sysinfo_dump(NULL); … … 952 929 } 953 930 954 /** Command for listing thread information 931 932 /** Command for listings Thread information 955 933 * 956 934 * @param argv Ignored … … 970 948 } 971 949 972 /** Command for listing task information950 /** Command for listings Task information 973 951 * 974 952 * @param argv Ignored … … 988 966 } 989 967 990 #ifdef CONFIG_UDEBUG 991 992 /** Command for printing thread stack trace 968 /** Command for listings Thread information 969 * 970 * @param argv Ignores 971 * 972 * @return Always 1 973 */ 974 int cmd_sched(cmd_arg_t * argv) 975 { 976 sched_print_list(); 977 return 1; 978 } 979 980 /** Command for listing memory zones 981 * 982 * @param argv Ignored 983 * 984 * return Always 1 985 */ 986 int cmd_zones(cmd_arg_t * argv) 987 { 988 zones_print_list(); 989 return 1; 990 } 991 992 /** Command for memory zone details 993 993 * 994 994 * @param argv Integer argument from cmdline expected 995 995 * 996 996 * return Always 1 997 * 998 */ 999 int cmd_btrace(cmd_arg_t *argv) 1000 { 1001 thread_stack_trace(argv[0].intval); 1002 return 1; 1003 } 1004 1005 #endif /* CONFIG_UDEBUG */ 1006 1007 /** Command for printing scheduler information 1008 * 1009 * @param argv Ignores 1010 * 1011 * @return Always 1 1012 */ 1013 int cmd_sched(cmd_arg_t *argv) 1014 { 1015 sched_print_list(); 1016 return 1; 1017 } 1018 1019 /** Command for listing memory zones 1020 * 1021 * @param argv Ignored 997 */ 998 int cmd_zone(cmd_arg_t * argv) 999 { 1000 zone_print_one(argv[0].intval); 1001 return 1; 1002 } 1003 1004 /** Command for printing task ipc details 1005 * 1006 * @param argv Integer argument from cmdline expected 1022 1007 * 1023 1008 * return Always 1 1024 1009 */ 1025 int cmd_ zones(cmd_arg_t *argv)1026 { 1027 zones_print_list();1028 return 1; 1029 } 1030 1031 /** Command for memory zone details1010 int cmd_ipc(cmd_arg_t * argv) 1011 { 1012 ipc_print_task(argv[0].intval); 1013 return 1; 1014 } 1015 1016 /** Command for killing a task 1032 1017 * 1033 1018 * @param argv Integer argument from cmdline expected 1034 1019 * 1035 * return Always 11036 */1037 int cmd_zone(cmd_arg_t *argv)1038 {1039 zone_print_one(argv[0].intval);1040 return 1;1041 }1042 1043 /** Command for printing task IPC details1044 *1045 * @param argv Integer argument from cmdline expected1046 *1047 * return Always 11048 */1049 int cmd_ipc(cmd_arg_t *argv)1050 {1051 ipc_print_task(argv[0].intval);1052 return 1;1053 }1054 1055 /** Command for killing a task1056 *1057 * @param argv Integer argument from cmdline expected1058 *1059 1020 * return 0 on failure, 1 on success. 1060 1021 */ 1061 int cmd_kill(cmd_arg_t * argv)1022 int cmd_kill(cmd_arg_t * argv) 1062 1023 { 1063 1024 if (task_kill(argv[0].intval) != EOK) -
kernel/generic/src/proc/scheduler.c
r875c629 rbf75e3cb 62 62 #include <print.h> 63 63 #include <debug.h> 64 #include <stacktrace.h> 65 64 65 static void before_task_runs(void); 66 static void before_thread_runs(void); 67 static void after_thread_ran(void); 66 68 static void scheduler_separated_stack(void); 67 69 … … 69 71 70 72 /** Carry out actions before new task runs. */ 71 staticvoid before_task_runs(void)73 void before_task_runs(void) 72 74 { 73 75 before_task_runs_arch(); … … 78 80 * Perform actions that need to be 79 81 * taken before the newly selected 80 * t hread is passed control.82 * tread is passed control. 81 83 * 82 84 * THREAD->lock is locked on entry 83 85 * 84 86 */ 85 staticvoid before_thread_runs(void)87 void before_thread_runs(void) 86 88 { 87 89 before_thread_runs_arch(); 88 89 90 #ifdef CONFIG_FPU_LAZY 90 if 91 if(THREAD == CPU->fpu_owner) 91 92 fpu_enable(); 92 93 else … … 101 102 } 102 103 #endif 103 104 #ifdef CONFIG_UDEBUG105 if (THREAD->btrace) {106 istate_t *istate = THREAD->udebug.uspace_state;107 if (istate != NULL) {108 printf("Thread %" PRIu64 " stack trace:\n", THREAD->tid);109 stack_trace_istate(istate);110 }111 112 THREAD->btrace = false;113 }114 #endif115 104 } 116 105 … … 124 113 * 125 114 */ 126 staticvoid after_thread_ran(void)115 void after_thread_ran(void) 127 116 { 128 117 after_thread_ran_arch(); … … 402 391 * possible destruction should thread_destroy() be called on this or any 403 392 * other processor while the scheduler is still using them. 393 * 404 394 */ 405 395 if (old_task) … … 427 417 * The thread structure is kept allocated until 428 418 * somebody calls thread_detach() on it. 419 * 429 420 */ 430 421 if (!irq_spinlock_trylock(&THREAD->join_wq.lock)) { 431 422 /* 432 423 * Avoid deadlock. 424 * 433 425 */ 434 426 irq_spinlock_unlock(&THREAD->lock, false); … … 451 443 /* 452 444 * Prefer the thread after it's woken up. 445 * 453 446 */ 454 447 THREAD->priority = -1; … … 458 451 * waitq_sleep(). Address of wq->lock is kept in 459 452 * THREAD->sleep_queue. 453 * 460 454 */ 461 455 irq_spinlock_unlock(&THREAD->sleep_queue->lock, false); … … 467 461 /* 468 462 * Entering state is unexpected. 463 * 469 464 */ 470 465 panic("tid%" PRIu64 ": unexpected state %s.", … … 485 480 486 481 /* 487 * If both the old and the new task are the same, 488 * lots of work is avoided. 482 * If both the old and the new task are the same, lots of work is 483 * avoided. 484 * 489 485 */ 490 486 if (TASK != THREAD->task) { … … 492 488 493 489 /* 494 * Note that it is possible for two tasks 495 * to share one address space. 490 * Note that it is possible for two tasks to share one address 491 * space. 492 ( 496 493 */ 497 494 if (old_as != new_as) { … … 499 496 * Both tasks and address spaces are different. 500 497 * Replace the old one with the new one. 498 * 501 499 */ 502 500 as_switch(old_as, new_as); … … 529 527 * necessary, is to be mapped in before_thread_runs(). This 530 528 * function must be executed before the switch to the new stack. 529 * 531 530 */ 532 531 before_thread_runs(); … … 535 534 * Copy the knowledge of CPU, TASK, THREAD and preemption counter to 536 535 * thread's stack. 536 * 537 537 */ 538 538 the_copy(THE, (the_t *) THREAD->kstack); … … 658 658 /* 659 659 * Ready thread on local CPU 660 * 660 661 */ 661 662 -
kernel/generic/src/proc/task.c
r875c629 rbf75e3cb 449 449 static void task_kill_internal(task_t *task) 450 450 { 451 link_t *cur; 452 453 /* 454 * Interrupt all threads. 455 */ 451 456 irq_spinlock_lock(&task->lock, false); 452 irq_spinlock_lock(&threads_lock, false);453 454 /*455 * Interrupt all threads.456 */457 458 link_t *cur;459 457 for (cur = task->th_head.next; cur != &task->th_head; cur = cur->next) { 460 458 thread_t *thread = list_get_instance(cur, thread_t, th_link); … … 473 471 } 474 472 475 irq_spinlock_unlock(&threads_lock, false);476 473 irq_spinlock_unlock(&task->lock, false); 477 474 } -
kernel/generic/src/proc/thread.c
r875c629 rbf75e3cb 239 239 * Switch thread to the ready state. 240 240 * 241 * @param t hreadThread to make ready.241 * @param t Thread to make ready. 242 242 * 243 243 */ … … 246 246 irq_spinlock_lock(&thread->lock, true); 247 247 248 ASSERT( thread->state != Ready);248 ASSERT(!(thread->state == Ready)); 249 249 250 250 int i = (thread->priority < RQ_COUNT - 1) … … 350 350 351 351 #ifdef CONFIG_UDEBUG 352 /* Initialize debugging stuff */ 353 thread->btrace = false; 352 /* Init debugging stuff */ 354 353 udebug_thread_initialize(&thread->udebug); 355 354 #endif … … 536 535 /** Detach thread. 537 536 * 538 * Mark the thread as detached . If the thread is already539 * in the Lingeringstate, deallocate its resources.537 * Mark the thread as detached, if the thread is already in the Lingering 538 * state, deallocate its resources. 540 539 * 541 540 * @param thread Thread to be detached. … … 741 740 ASSERT(interrupts_disabled()); 742 741 ASSERT(irq_spinlock_locked(&threads_lock)); 743 742 744 743 thread_iterator_t iterator; 745 744 … … 752 751 } 753 752 754 #ifdef CONFIG_UDEBUG755 756 void thread_stack_trace(thread_id_t thread_id)757 {758 irq_spinlock_lock(&threads_lock, true);759 760 thread_t *thread = thread_find_by_id(thread_id);761 if (thread == NULL) {762 printf("No such thread.\n");763 irq_spinlock_unlock(&threads_lock, true);764 return;765 }766 767 irq_spinlock_lock(&thread->lock, false);768 769 /*770 * Schedule a stack trace to be printed771 * just before the thread is scheduled next.772 *773 * If the thread is sleeping then try to interrupt774 * the sleep. Any request for printing an uspace stack775 * trace from within the kernel should be always776 * considered a last resort debugging means, therefore777 * forcing the thread's sleep to be interrupted778 * is probably justifiable.779 */780 781 bool sleeping = false;782 istate_t *istate = thread->udebug.uspace_state;783 if (istate != NULL) {784 printf("Scheduling thread stack trace.\n");785 thread->btrace = true;786 if (thread->state == Sleeping)787 sleeping = true;788 } else789 printf("Thread interrupt state not available.\n");790 791 irq_spinlock_unlock(&thread->lock, false);792 793 if (sleeping)794 waitq_interrupt_sleep(thread);795 796 irq_spinlock_unlock(&threads_lock, true);797 }798 799 #endif /* CONFIG_UDEBUG */800 753 801 754 /** Process syscall to create new thread. … … 840 793 * has already been created. We need to undo its 841 794 * creation now. 795 * 842 796 */ 843 797 … … 861 815 * THREAD_B events for threads that already existed 862 816 * and could be detected with THREAD_READ before. 817 * 863 818 */ 864 819 udebug_thread_b_event_attach(thread, TASK); -
kernel/generic/src/synch/waitq.c
r875c629 rbf75e3cb 127 127 /** Interrupt sleeping thread. 128 128 * 129 * This routine attempts to interrupt a thread from its sleep in 130 * a waitqueue. If the thread is not found sleeping, no action 131 * is taken. 132 * 133 * The threads_lock must be already held and interrupts must be 134 * disabled upon calling this function. 129 * This routine attempts to interrupt a thread from its sleep in a waitqueue. 130 * If the thread is not found sleeping, no action is taken. 135 131 * 136 132 * @param thread Thread to be interrupted. … … 142 138 DEADLOCK_PROBE_INIT(p_wqlock); 143 139 144 /* 145 * The thread is quaranteed to exist because 146 * threads_lock is held. 147 */ 140 irq_spinlock_lock(&threads_lock, true); 141 if (!thread_exists(thread)) 142 goto out; 148 143 149 144 grab_locks: … … 155 150 /* 156 151 * The sleep cannot be interrupted. 152 * 157 153 */ 158 154 irq_spinlock_unlock(&thread->lock, false); 159 return;155 goto out; 160 156 } 161 157 162 158 if (!irq_spinlock_trylock(&wq->lock)) { 163 /* Avoid deadlock */164 159 irq_spinlock_unlock(&thread->lock, false); 165 160 DEADLOCK_PROBE(p_wqlock, DEADLOCK_THRESHOLD); 161 /* Avoid deadlock */ 166 162 goto grab_locks; 167 163 } … … 177 173 irq_spinlock_unlock(&wq->lock, false); 178 174 } 179 180 175 irq_spinlock_unlock(&thread->lock, false); 181 176 182 177 if (do_wakeup) 183 178 thread_ready(thread); 179 180 out: 181 irq_spinlock_unlock(&threads_lock, true); 184 182 } 185 183 … … 372 370 * If the thread was already interrupted, 373 371 * don't go to sleep at all. 372 * 374 373 */ 375 374 if (THREAD->interrupted) { … … 382 381 * Set context that will be restored if the sleep 383 382 * of this thread is ever interrupted. 383 * 384 384 */ 385 385 THREAD->sleep_interruptible = true;
Note:
See TracChangeset
for help on using the changeset viewer.