// File: enbock[P]Warp10Server/ulib/src/Thread.cpp
// Function: u::ThreadSystem::create(u::Callback*)
bool ThreadSystem::create(Callback *cb)
{
	_access.lock();
	if(isTerminating) {
		_access.unlock();
		return false;
	}

	Thread *t = new Thread(cb);

	_build.push_back(t);
	_access.unlock();

#ifndef NDEBUG
	trace(
		"\033[0mThreadSystem::create: " + Object::ptr2string(cb)
		 + " -> " +  Object::ptr2string(&(t->_call))
		 //+ "\n\033[37m" + ThreadSystem::toString()
	);
#endif

	return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x170, %rsp            # imm = 0x170
movq %rdi, -0x10(%rbp)
leaq 0x20882a(%rip), %rdi    # 0x6196b0
callq 0x40d7d0
testb $0x1, 0x208817(%rip)    # 0x6196a9
je 0x410ea9
leaq 0x208815(%rip), %rdi    # 0x6196b0
callq 0x40d740
movb $0x0, -0x1(%rbp)
jmp 0x4111c7
movl $0x98, %edi
callq 0x414cb0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x150(%rbp)
movq -0x10(%rbp), %rsi
callq 0x410630
jmp 0x410ecb
movq -0x150(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq 0x20880b(%rip), %rdi    # 0x6196e8
addq $0x38, %rdi
leaq -0x18(%rbp), %rsi
callq 0x412490
leaq 0x2087bf(%rip), %rdi    # 0x6196b0
callq 0x40d740
movq $0x61a6a0, %rdi         # imm = 0x61A6A0
leaq 0x18e175(%rip), %rsi    # 0x59f079
callq 0x47dcd0
movq %rax, -0x158(%rbp)
movb $0x0, -0xe1(%rbp)
movb $0x0, -0xe2(%rbp)
movb $0x0, -0xe3(%rbp)
movb $0x0, -0x141(%rbp)
movb $0x0, -0x143(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x410f3e
jmp 0x410fc9
movq -0x10(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x40dd50
movb $0x1, -0xe1(%rbp)
leaq -0xa8(%rbp), %rdx
leaq 0x18e719(%rip), %rsi    # 0x59f67c
leaq -0x88(%rbp), %rdi
callq 0x405790
jmp 0x410f71
movb $0x1, -0xe2(%rbp)
leaq 0x18e3e2(%rip), %rdx    # 0x59f361
leaq -0x68(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x405740
jmp 0x410f91
movb $0x1, -0xe3(%rbp)
movq -0x18(%rbp), %rsi
leaq -0x140(%rbp), %rdi
callq 0x40dd50
jmp 0x410faa
movb $0x1, -0x141(%rbp)
leaq -0x108(%rbp), %rdx
leaq -0x48(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x407710
jmp 0x410fc7
jmp 0x410ffe
leaq -0x142(%rbp), %rdi
movq %rdi, -0x160(%rbp)
callq 0x415b00
movq -0x160(%rbp), %rdx
movb $0x1, -0x143(%rbp)
leaq 0x1ada99(%rip), %rsi    # 0x5bea8a
leaq -0x48(%rbp), %rdi
callq 0x405e40
jmp 0x410ffc
jmp 0x410ffe
movq -0x158(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x490550
movq %rax, -0x168(%rbp)
jmp 0x411017
movq -0x168(%rbp), %rdi
leaq 0x18e076(%rip), %rsi    # 0x59f09b
callq 0x47dcd0
movq %rax, -0x170(%rbp)
jmp 0x411033
movq -0x170(%rbp), %rdi
movq $0x47d5b0, %rsi         # imm = 0x47D5B0
callq 0x47c7c0
jmp 0x411048
leaq -0x48(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x143(%rbp)
jne 0x41105c
jmp 0x411068
leaq -0x142(%rbp), %rdi
callq 0x415b20
testb $0x1, -0x141(%rbp)
jne 0x411073
jmp 0x41107f
leaq -0x140(%rbp), %rdi
callq 0x404d10
testb $0x1, -0xe3(%rbp)
jne 0x41108a
jmp 0x411093
leaq -0x68(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0xe2(%rbp)
jne 0x41109e
jmp 0x4110aa
leaq -0x88(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0xe1(%rbp)
jne 0x4110b5
jmp 0x4110c1
leaq -0xe0(%rbp), %rdi
callq 0x404d10
movb $0x1, -0x1(%rbp)
jmp 0x4111c7
movq -0x150(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x98, %esi
callq 0x413b20
jmp 0x4111d5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x4111ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x411195
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x41117f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x411166
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x41114d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x48(%rbp), %rdi
callq 0x48dbd0
testb $0x1, -0x143(%rbp)
jne 0x411158
jmp 0x411164
leaq -0x142(%rbp), %rdi
callq 0x415b20
jmp 0x411166
testb $0x1, -0x141(%rbp)
jne 0x411171
jmp 0x41117d
leaq -0x140(%rbp), %rdi
callq 0x404d10
jmp 0x41117f
testb $0x1, -0xe3(%rbp)
jne 0x41118a
jmp 0x411193
leaq -0x68(%rbp), %rdi
callq 0x48dbd0
jmp 0x411195
testb $0x1, -0xe2(%rbp)
jne 0x4111a0
jmp 0x4111ac
leaq -0x88(%rbp), %rdi
callq 0x48dbd0
jmp 0x4111ae
testb $0x1, -0xe1(%rbp)
jne 0x4111b9
jmp 0x4111c5
leaq -0xe0(%rbp), %rdi
callq 0x404d10
jmp 0x4111d5
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x170, %rsp            # imm = 0x170
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x4be910
nop