// File: Kingsford-Group[P]ghost2/include/./threadpool/./detail/pool_core.hpp
// Function: boost::threadpool::detail::pool_core<boost::function0<void>, boost::threadpool::fifo_scheduler, boost::threadpool::static_size, boost::threadpool::resize_controller, boost::threadpool::wait_for_all_tasks>::execute_task() volatile
bool execute_task() volatile
    {
      function0<void> task;

      { // fetch task
        pool_type* lockedThis = const_cast<pool_type*>(this);
        recursive_mutex::scoped_lock lock(lockedThis->m_monitor);

        // decrease number of threads if necessary
        if(m_worker_count > m_target_worker_count)
        {	
          return false;	// terminate worker
        }


        // wait for tasks
        while(lockedThis->m_scheduler.empty())
        {	
          // decrease number of workers if necessary
          if(m_worker_count > m_target_worker_count)
          {	
            return false;	// terminate worker
          }
          else
          {
            m_active_worker_count--;
            lockedThis->m_worker_idle_or_terminated_event.notify_all();	
            lockedThis->m_task_or_terminate_workers_event.wait(lock);
            m_active_worker_count++;
          }
        }

        task = lockedThis->m_scheduler.top();
        lockedThis->m_scheduler.pop();
      }

      // call task function
      if(task)
      {
        task();
      }
 
      //guard->disable();
      return true;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x8a850
movq -0x60(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rsi
addq $0xa0, %rsi
leaq -0x48(%rbp), %rdi
callq 0x85bc0
jmp 0x892eb
movq -0x60(%rbp), %rcx
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rcx
cmpq %rcx, %rax
jbe 0x8931d
movb $0x0, -0x1(%rbp)
movl $0x1, -0x58(%rbp)
jmp 0x893f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
jmp 0x8944b
jmp 0x8931f
movq -0x38(%rbp), %rdi
addq $0x28, %rdi
callq 0x85bf0
testb $0x1, %al
jne 0x89335
jmp 0x893bc
movq -0x60(%rbp), %rcx
movq 0x10(%rcx), %rax
movq 0x18(%rcx), %rcx
cmpq %rcx, %rax
jbe 0x89356
movb $0x0, -0x1(%rbp)
movl $0x1, -0x58(%rbp)
jmp 0x893f4
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rcx
decq %rcx
movq %rcx, 0x20(%rax)
movq -0x38(%rbp), %rdi
addq $0xc8, %rdi
callq 0x87150
movq -0x38(%rbp), %rdi
addq $0x120, %rdi            # imm = 0x120
leaq -0x48(%rbp), %rsi
callq 0x85c10
jmp 0x8938b
movq -0x60(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
jmp 0x893b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x50(%rbp)
movl %eax, -0x54(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x85da0
jmp 0x8944b
jmp 0x8931f
movq -0x38(%rbp), %rdi
addq $0x28, %rdi
callq 0x8a870
movq %rax, -0x68(%rbp)
jmp 0x893cf
movq -0x68(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x8a890
jmp 0x893de
movq -0x38(%rbp), %rdi
addq $0x28, %rdi
callq 0x8a940
jmp 0x893ed
movl $0x0, -0x58(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x85da0
movl -0x58(%rbp), %eax
testl %eax, %eax
jne 0x89437
jmp 0x89406
leaq -0x30(%rbp), %rdi
callq 0x8a960
movq %rax, -0x70(%rbp)
jmp 0x89415
movq -0x70(%rbp), %rax
cmpq $0x0, %rax
je 0x8942c
leaq -0x30(%rbp), %rdi
callq 0x8a990
jmp 0x8942a
jmp 0x8942c
movb $0x1, -0x1(%rbp)
movl $0x1, -0x58(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x261a0
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x261a0
movq -0x50(%rbp), %rdi
callq 0x10cc0
nopl (%rax)