// File: enbock[P]Warp10Server/ulib/src/Thread.cpp
// Function: u::ThreadSystem::destroy(u::Thread*)
void ThreadSystem::destroy(Thread *thread)
{
	int64 i,l;
	_access.lock();
	l = _run.size();
	for(i=0; i<l; i++)
	{
		if(_run.at(i) == thread)
		{
			_run.erase(i);
#ifndef NDEBUG
			finish++;
			if(ThreadSystem::isTerminating)
				trace("Run queue="+Object::int2string(_build.size())
				+ "\trun="+Object::int2string(_run.size())
				+ "(peak:"+Object::int2string(peakRun)+")"
				+ "\tfinished="+Object::int2string(finish)
				);
#endif
			_access.unlock();
			delete thread;
			return;
		}
	}
	_access.unlock();
#ifndef NDEBUG
	error("A deleting thread was not found in the run queue.");
	assert(false==true);
#endif
	//delete thread;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2d0, %rsp            # imm = 0x2D0
movq %rdi, -0x8(%rbp)
leaq 0x208f7a(%rip), %rdi    # 0x6196b0
callq 0x40d7d0
leaq 0x208ff6(%rip), %rdi    # 0x619738
addq $0x38, %rdi
callq 0x412500
movq %rax, -0x18(%rbp)
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x18(%rbp), %rax
jge 0x410dec
movq -0x10(%rbp), %rsi
leaq 0x208fc8(%rip), %rdi    # 0x619738
addq $0x38, %rdi
callq 0x412520
movq (%rax), %rax
cmpq -0x8(%rbp), %rax
jne 0x410dd9
movq -0x10(%rbp), %rsi
leaq 0x208fa7(%rip), %rdi    # 0x619738
callq 0x412560
movq 0x208feb(%rip), %rax    # 0x619788
addq $0x1, %rax
movq %rax, 0x208fe0(%rip)    # 0x619788
testb $0x1, 0x208efa(%rip)    # 0x6196a9
je 0x410d96
movq $0x61a6a0, %rdi         # imm = 0x61A6A0
leaq 0x18e8b6(%rip), %rsi    # 0x59f079
callq 0x47dcd0
movq %rax, -0x2b0(%rbp)
movb $0x0, -0x171(%rbp)
movb $0x0, -0x185(%rbp)
movb $0x0, -0x186(%rbp)
movb $0x0, -0x1e1(%rbp)
movb $0x0, -0x1e2(%rbp)
movb $0x0, -0x1e3(%rbp)
movb $0x0, -0x241(%rbp)
movb $0x0, -0x242(%rbp)
movb $0x0, -0x243(%rbp)
movb $0x0, -0x244(%rbp)
movb $0x0, -0x2a1(%rbp)
movb $0x0, -0x2a3(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x41082e
jmp 0x4109ac
leaq 0x208eeb(%rip), %rdi    # 0x619720
callq 0x412500
movl %eax, %esi
leaq -0x170(%rbp), %rdi
callq 0x40dc60
movb $0x1, -0x171(%rbp)
leaq -0x138(%rbp), %rdx
leaq 0x18f111(%rip), %rsi    # 0x59f96e
leaq -0x118(%rbp), %rdi
callq 0x405790
jmp 0x41086b
movb $0x1, -0x185(%rbp)
leaq 0x18eece(%rip), %rdx    # 0x59f747
leaq -0xf8(%rbp), %rdi
leaq -0x118(%rbp), %rsi
callq 0x405740
jmp 0x41088e
movb $0x1, -0x186(%rbp)
leaq 0x208ed4(%rip), %rdi    # 0x619770
callq 0x412500
movl %eax, %esi
leaq -0x1e0(%rbp), %rdi
callq 0x40dc60
jmp 0x4108b1
movb $0x1, -0x1e1(%rbp)
leaq -0x1a8(%rbp), %rdx
leaq -0xd8(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
callq 0x407710
jmp 0x4108d4
movb $0x1, -0x1e2(%rbp)
leaq 0x18ee6b(%rip), %rdx    # 0x59f74d
leaq -0xb8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x405740
jmp 0x4108f7
movb $0x1, -0x1e3(%rbp)
movl 0x208e8c(%rip), %esi    # 0x619790
leaq -0x240(%rbp), %rdi
callq 0x40dc60
jmp 0x410912
movb $0x1, -0x241(%rbp)
leaq -0x208(%rbp), %rdx
leaq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x407710
jmp 0x410935
movb $0x1, -0x242(%rbp)
leaq 0x18e74f(%rip), %rdx    # 0x59f092
leaq -0x78(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x405740
jmp 0x410955
movb $0x1, -0x243(%rbp)
leaq 0x18edf1(%rip), %rdx    # 0x59f754
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x405740
jmp 0x410972
movb $0x1, -0x244(%rbp)
movl 0x208e09(%rip), %esi    # 0x619788
leaq -0x2a0(%rbp), %rdi
callq 0x40dc60
jmp 0x41098d
movb $0x1, -0x2a1(%rbp)
leaq -0x268(%rbp), %rdx
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0x407710
jmp 0x4109aa
jmp 0x4109e1
leaq -0x2a2(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x415b00
movq -0x2b8(%rbp), %rdx
movb $0x1, -0x2a3(%rbp)
leaq 0x1ae0b6(%rip), %rsi    # 0x5bea8a
leaq -0x38(%rbp), %rdi
callq 0x405e40
jmp 0x4109df
jmp 0x4109e1
movq -0x2b0(%rbp), %rdi
leaq -0x38(%rbp), %rsi
callq 0x490550
movq %rax, -0x2c0(%rbp)
jmp 0x4109fa
movq -0x2c0(%rbp), %rdi
leaq 0x18e693(%rip), %rsi    # 0x59f09b
callq 0x47dcd0
movq %rax, -0x2c8(%rbp)
jmp 0x410a16
movq -0x2c8(%rbp), %rdi
movq $0x47d5b0, %rsi         # imm = 0x47D5B0
callq 0x47c7c0
jmp 0x410a2b
leaq -0x38(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x2a3(%rbp)
jne 0x410a3f
jmp 0x410a4b
leaq -0x2a2(%rbp), %rdi
callq 0x415b20
testb $0x1, -0x2a1(%rbp)
jne 0x410a56
jmp 0x410a62
leaq -0x2a0(%rbp), %rdi
callq 0x404d10
testb $0x1, -0x244(%rbp)
jne 0x410a6d
jmp 0x410a76
leaq -0x58(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x243(%rbp)
jne 0x410a81
jmp 0x410a8a
leaq -0x78(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x242(%rbp)
jne 0x410a95
jmp 0x410aa1
leaq -0x98(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x241(%rbp)
jne 0x410aac
jmp 0x410ab8
leaq -0x240(%rbp), %rdi
callq 0x404d10
testb $0x1, -0x1e3(%rbp)
jne 0x410ac3
jmp 0x410acf
leaq -0xb8(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x1e2(%rbp)
jne 0x410ada
jmp 0x410ae6
leaq -0xd8(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x1e1(%rbp)
jne 0x410af1
jmp 0x410afd
leaq -0x1e0(%rbp), %rdi
callq 0x404d10
testb $0x1, -0x186(%rbp)
jne 0x410b08
jmp 0x410b14
leaq -0xf8(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x185(%rbp)
jne 0x410b1f
jmp 0x410b2b
leaq -0x118(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x171(%rbp)
jne 0x410b36
jmp 0x410b42
leaq -0x170(%rbp), %rdi
callq 0x404d10
jmp 0x410d96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410d7a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410d61
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410d48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410d2f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410d16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410cfd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410ce4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410ccb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410cb5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410c9f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410c86
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
jmp 0x410c6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x180(%rbp)
movl %eax, -0x184(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x2a3(%rbp)
jne 0x410c78
jmp 0x410c84
leaq -0x2a2(%rbp), %rdi
callq 0x415b20
jmp 0x410c86
testb $0x1, -0x2a1(%rbp)
jne 0x410c91
jmp 0x410c9d
leaq -0x2a0(%rbp), %rdi
callq 0x404d10
jmp 0x410c9f
testb $0x1, -0x244(%rbp)
jne 0x410caa
jmp 0x410cb3
leaq -0x58(%rbp), %rdi
callq 0x48dbd0
jmp 0x410cb5
testb $0x1, -0x243(%rbp)
jne 0x410cc0
jmp 0x410cc9
leaq -0x78(%rbp), %rdi
callq 0x48dbd0
jmp 0x410ccb
testb $0x1, -0x242(%rbp)
jne 0x410cd6
jmp 0x410ce2
leaq -0x98(%rbp), %rdi
callq 0x48dbd0
jmp 0x410ce4
testb $0x1, -0x241(%rbp)
jne 0x410cef
jmp 0x410cfb
leaq -0x240(%rbp), %rdi
callq 0x404d10
jmp 0x410cfd
testb $0x1, -0x1e3(%rbp)
jne 0x410d08
jmp 0x410d14
leaq -0xb8(%rbp), %rdi
callq 0x48dbd0
jmp 0x410d16
testb $0x1, -0x1e2(%rbp)
jne 0x410d21
jmp 0x410d2d
leaq -0xd8(%rbp), %rdi
callq 0x48dbd0
jmp 0x410d2f
testb $0x1, -0x1e1(%rbp)
jne 0x410d3a
jmp 0x410d46
leaq -0x1e0(%rbp), %rdi
callq 0x404d10
jmp 0x410d48
testb $0x1, -0x186(%rbp)
jne 0x410d53
jmp 0x410d5f
leaq -0xf8(%rbp), %rdi
callq 0x48dbd0
jmp 0x410d61
testb $0x1, -0x185(%rbp)
jne 0x410d6c
jmp 0x410d78
leaq -0x118(%rbp), %rdi
callq 0x48dbd0
jmp 0x410d7a
testb $0x1, -0x171(%rbp)
jne 0x410d85
jmp 0x410d91
leaq -0x170(%rbp), %rdi
callq 0x404d10
jmp 0x410e57
leaq 0x208913(%rip), %rdi    # 0x6196b0
callq 0x40d740
movq -0x8(%rbp), %rax
movq %rax, -0x2d0(%rbp)
cmpq $0x0, %rax
je 0x410dd0
movq -0x2d0(%rbp), %rdi
callq 0x410690
movq -0x2d0(%rbp), %rdi
movl $0x98, %esi
callq 0x413b20
addq $0x2d0, %rsp            # imm = 0x2D0
popq %rbp
retq
jmp 0x410ddb
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x410757
leaq 0x2088bd(%rip), %rdi    # 0x6196b0
callq 0x40d740
movq $0x61a580, %rdi         # imm = 0x61A580
leaq 0x18e3bf(%rip), %rsi    # 0x59f1c5
callq 0x47dcd0
movq %rax, %rdi
leaq 0x18e94a(%rip), %rsi    # 0x59f75f
callq 0x47dcd0
movq %rax, %rdi
leaq 0x18e277(%rip), %rsi    # 0x59f09b
callq 0x47dcd0
movq %rax, %rdi
movq $0x47d5b0, %rsi         # imm = 0x47D5B0
callq 0x47c7c0
leaq 0x18e952(%rip), %rdi    # 0x59f791
leaq 0x18e957(%rip), %rsi    # 0x59f79d
movl $0x64, %edx
leaq 0x18e95a(%rip), %rcx    # 0x59f7ac
callq 0x4d3570
movq -0x180(%rbp), %rdi
callq 0x4be910
nopw %cs:(%rax,%rax)