// File: merelin[P]mediasmartserverd/src/update_monitor.cpp
// Function: UpdateMonitor::Stop()
void UpdateMonitor::Stop()
{
	if (!instance_started_)
	{
		if (verbose > 0)
		{
			std::cout << "Update monitor thread already stopped.\n";
		}
		return;
	}
	if (verbose > 0)
	{
		std::cout << "Attempting to stop update monitor thread.\n";
	}
	//Cancelling thread.
	if(pthread_cancel(monitor_thread_) != 0)
	{
		throw ErrnoException("pthread_cancel");
	}
	//Waiting for thread to join.
	if(pthread_join(monitor_thread_, NULL) != 0)
	{
		throw ErrnoException("pthread_join");
	}
	if (verbose > 0)
	{
		std::cout << "Update monitor thread stopped.\n";
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
testb $0x1, 0xfde2(%rip)      # 0x18410
jne 0x8654
leaq 0xfde5(%rip), %rax      # 0x1841c
cmpl $0x0, (%rax)
jle 0x864f
movq 0xf96d(%rip), %rdi      # 0x17fb0
leaq 0x9d55(%rip), %rsi      # 0x1239f
callq 0x5380
jmp 0x8826
leaq 0xfdc1(%rip), %rax      # 0x1841c
cmpl $0x0, (%rax)
jle 0x8673
movq 0xf949(%rip), %rdi      # 0x17fb0
leaq 0x9d59(%rip), %rsi      # 0x123c7
callq 0x5380
movq -0x70(%rbp), %rax
movq (%rax), %rdi
callq 0x5570
cmpl $0x0, %eax
je 0x8735
movb $0x1, -0x3d(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x80(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x56c0
movq -0x78(%rbp), %rdx
leaq 0x9d40(%rip), %rsi      # 0x123f2
leaq -0x28(%rbp), %rdi
callq 0x7600
jmp 0x86bd
callq 0x5030
movq -0x80(%rbp), %rdi
movl (%rax), %edx
leaq -0x28(%rbp), %rsi
callq 0x76b0
jmp 0x86d3
movq -0x80(%rbp), %rdi
movb $0x0, -0x3d(%rbp)
leaq 0xef1e(%rip), %rsi      # 0x17600
leaq -0xf69(%rip), %rdx      # 0x7780
callq 0x5680
jmp 0x8838
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x8716
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x5230
leaq -0x29(%rbp), %rdi
callq 0x53f0
testb $0x1, -0x3d(%rbp)
jne 0x8727
jmp 0x8730
movq -0x80(%rbp), %rdi
callq 0x52a0
jmp 0x882f
movq -0x70(%rbp), %rax
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x5350
cmpl $0x0, %eax
je 0x8807
movb $0x1, -0x62(%rbp)
movl $0x10, %edi
callq 0x51b0
movq %rax, -0x90(%rbp)
leaq -0x61(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x56c0
movq -0x88(%rbp), %rdx
leaq 0x9c80(%rip), %rsi      # 0x12401
leaq -0x60(%rbp), %rdi
callq 0x7600
jmp 0x878c
callq 0x5030
movq -0x90(%rbp), %rdi
movl (%rax), %edx
leaq -0x60(%rbp), %rsi
callq 0x76b0
jmp 0x87a5
movq -0x90(%rbp), %rdi
movb $0x0, -0x62(%rbp)
leaq 0xee49(%rip), %rsi      # 0x17600
leaq -0x103e(%rip), %rdx     # 0x7780
callq 0x5680
jmp 0x8838
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x87e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x5230
leaq -0x61(%rbp), %rdi
callq 0x53f0
testb $0x1, -0x62(%rbp)
jne 0x87f9
jmp 0x8805
movq -0x90(%rbp), %rdi
callq 0x52a0
jmp 0x882f
leaq 0xfc0e(%rip), %rax      # 0x1841c
cmpl $0x0, (%rax)
jle 0x8826
movq 0xf796(%rip), %rdi      # 0x17fb0
leaq 0x9bed(%rip), %rsi      # 0x1240e
callq 0x5380
addq $0x90, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x56b0
nopl (%rax,%rax)