equal
deleted
inserted
replaced
3488 // Hint to the underlying OS that a task switch would not be good. |
3488 // Hint to the underlying OS that a task switch would not be good. |
3489 // Void return because it's a hint and can fail. |
3489 // Void return because it's a hint and can fail. |
3490 void os::hint_no_preempt() {} |
3490 void os::hint_no_preempt() {} |
3491 |
3491 |
3492 void os::interrupt(Thread* thread) { |
3492 void os::interrupt(Thread* thread) { |
3493 assert(!thread->is_Java_thread() || Thread::current() == thread || |
3493 debug_only(Thread::check_for_dangling_thread_pointer(thread);) |
3494 Threads_lock->owned_by_self(), |
|
3495 "possibility of dangling Thread pointer"); |
|
3496 |
3494 |
3497 OSThread* osthread = thread->osthread(); |
3495 OSThread* osthread = thread->osthread(); |
3498 osthread->set_interrupted(true); |
3496 osthread->set_interrupted(true); |
3499 // More than one thread can get here with the same value of osthread, |
3497 // More than one thread can get here with the same value of osthread, |
3500 // resulting in multiple notifications. We do, however, want the store |
3498 // resulting in multiple notifications. We do, however, want the store |
3511 if (ev != NULL) ev->unpark(); |
3509 if (ev != NULL) ev->unpark(); |
3512 } |
3510 } |
3513 |
3511 |
3514 |
3512 |
3515 bool os::is_interrupted(Thread* thread, bool clear_interrupted) { |
3513 bool os::is_interrupted(Thread* thread, bool clear_interrupted) { |
3516 assert(!thread->is_Java_thread() || Thread::current() == thread || Threads_lock->owned_by_self(), |
3514 debug_only(Thread::check_for_dangling_thread_pointer(thread);) |
3517 "possibility of dangling Thread pointer"); |
|
3518 |
3515 |
3519 OSThread* osthread = thread->osthread(); |
3516 OSThread* osthread = thread->osthread(); |
3520 // There is no synchronization between the setting of the interrupt |
3517 // There is no synchronization between the setting of the interrupt |
3521 // and it being cleared here. It is critical - see 6535709 - that |
3518 // and it being cleared here. It is critical - see 6535709 - that |
3522 // we only clear the interrupt state, and reset the interrupt event, |
3519 // we only clear the interrupt state, and reset the interrupt event, |