Ejemplo n.º 1
0
void *_handle_dst_link_handler_thread(void *data)
{
	knet_handle_t knet_h = (knet_handle_t) data;
	struct epoll_event events[KNET_EPOLL_MAX_EVENTS];

	set_thread_status(knet_h, KNET_THREAD_DST_LINK, KNET_THREAD_STARTED);

	while (!shutdown_in_progress(knet_h)) {
		if (epoll_wait(knet_h->dst_link_handler_epollfd, events, KNET_EPOLL_MAX_EVENTS, knet_h->threads_timer_res / 1000) >= 1)
			_handle_dst_link_updates(knet_h);
	}

	set_thread_status(knet_h, KNET_THREAD_DST_LINK, KNET_THREAD_STOPPED);

	return NULL;
}
Ejemplo n.º 2
0
 static bool contended_enter_begin(JavaThread *java_thread) {
   set_thread_status(java_thread, java_lang_Thread::BLOCKED_ON_MONITOR_ENTER);
   ThreadStatistics* stat = java_thread->get_thread_stat();
   stat->contended_enter();
   bool active = ThreadService::is_thread_monitoring_contention();
   if (active) {
     stat->contended_enter_begin();
   }
   return active;
 }
Ejemplo n.º 3
0
 static void wait_reenter_end(JavaThread *java_thread, bool active) {
   if (active) {
     java_thread->get_thread_stat()->contended_enter_end();
   }
   set_thread_status(java_thread, java_lang_Thread::RUNNABLE);
 }
Ejemplo n.º 4
0
 ~JavaThreadStatusChanger() {
   set_thread_status(_old_state);
 }
Ejemplo n.º 5
0
 JavaThreadStatusChanger(JavaThread* java_thread,
                         java_lang_Thread::ThreadStatus state) {
   save_old_state(java_thread);
   set_thread_status(state);
 }
Ejemplo n.º 6
0
 void set_thread_status(java_lang_Thread::ThreadStatus state) {
   if (is_alive()) {
     set_thread_status(_java_thread, state);
   }
 }