// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libParallel/parallel_channel.cpp
// Function: CChannel_import::send(void*, bool)
bool send(TChanData data,bool isWait){
        assert(data!=0);
        {
            CAutoLocker locker(_locker);
            while (true) {
                if (_isClosed) return false;
                if ((_maxDataCount<=0)||(_dataList.size()<(size_t)_maxDataCount)) {
                    try{
                        _dataList.push_back(data);
                    }catch(...){
                        return false;
                    }
                    condvar_signal(_acceptCond);
                    if (_maxDataCount==0) //must wait accepted?
                        break;// to wait accepted
                    else
                        return true; //ok
                }else if(!isWait){
                    return false;
                }//else wait
                ++_waitingCount;
                condvar_wait(_sendCond,&locker);
                --_waitingCount;
            }
        }

        //wait accepted
        while (true) { //wait _dataList empty
            {
                CAutoLocker locker(_locker);
                if (_isClosed) break;
                if (_dataList.empty()) break;
            }
            this_thread_yield(); //todo:优化;
        }
        return true;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x20(%rsp)
testq %rsi, %rsi
je 0x49b7d
movl %edx, %ebp
movq %rdi, %rbx
movq (%rdi), %rax
movq $0x0, (%rsp)
movb $0x0, 0x8(%rsp)
testq %rax, %rax
je 0x49a25
leaq 0x10(%rsp), %rdi
movq %rax, (%rdi)
movb $0x0, 0x8(%rdi)
callq 0x2099a
leaq 0x10(%rsp), %rdi
movq (%rdi), %rax
movq (%rsp), %rcx
movq %rcx, (%rdi)
movq %rax, (%rsp)
movb 0x8(%rsp), %al
movb %al, 0x8(%rdi)
movb $0x1, 0x8(%rsp)
callq 0x20984
cmpb $0x0, 0x78(%rbx)
je 0x49a35
xorl %ebp, %ebp
xorl %r14d, %r14d
jmp 0x49ae4
movq %rsp, %r14
movq 0x68(%rbx), %rax
testq %rax, %rax
jle 0x49aa1
movq 0x60(%rbx), %rcx
movq %rcx, %rdx
subq 0x40(%rbx), %rdx
shrq $0x3, %rdx
cmpq $0x1, %rcx
adcq $-0x1, %rdx
shlq $0x6, %rdx
movq 0x48(%rbx), %rcx
subq 0x50(%rbx), %rcx
movq 0x38(%rbx), %rsi
sarq $0x3, %rcx
subq 0x28(%rbx), %rsi
sarq $0x3, %rsi
addq %rcx, %rsi
addq %rdx, %rsi
cmpq %rax, %rsi
jb 0x49aa1
testb %bpl, %bpl
je 0x49a2b
incq 0x70(%rbx)
movq 0x8(%rbx), %rdi
movq %r14, %rsi
callq 0x4949f
decq 0x70(%rbx)
movb 0x78(%rbx), %al
cmpb $0x1, %al
jne 0x49a38
jmp 0x49a2b
movq 0x48(%rbx), %rax
movq 0x58(%rbx), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
je 0x49ac1
movq 0x20(%rsp), %rcx
movq %rcx, (%rax)
addq $0x8, 0x48(%rbx)
jmp 0x49acf
leaq 0x18(%rbx), %rdi
leaq 0x20(%rsp), %rsi
callq 0x49e72
movq 0x10(%rbx), %rdi
callq 0x494a4
cmpq $0x0, 0x68(%rbx)
sete %r14b
movb $0x1, %bpl
movq %rsp, %rdi
callq 0x20984
testb %r14b, %r14b
je 0x49b6c
leaq 0x10(%rsp), %r15
movq (%rbx), %rax
movq $0x0, (%rsp)
movb $0x0, 0x8(%rsp)
testq %rax, %rax
je 0x49b44
movq %rax, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq %r15, %rdi
callq 0x2099a
movq 0x10(%rsp), %rax
movq (%rsp), %rcx
movq %rcx, 0x10(%rsp)
movq %rax, (%rsp)
movb 0x8(%rsp), %al
movb %al, 0x18(%rsp)
movb $0x1, 0x8(%rsp)
movq %r15, %rdi
callq 0x20984
movq 0x28(%rbx), %r12
movq 0x48(%rbx), %r13
movb 0x78(%rbx), %r14b
movq %rsp, %rdi
callq 0x20984
movb $0x1, %bpl
testb %r14b, %r14b
jne 0x49b6c
cmpq %r12, %r13
je 0x49b6c
callq 0x494ae
jmp 0x49af6
movl %ebp, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x18a3a(%rip), %rdi     # 0x625be
leaq 0x189e1(%rip), %rsi     # 0x6256c
leaq 0x18a34(%rip), %rcx     # 0x625c6
movl $0x55, %edx
callq 0x4200
movq %rax, %rdi
callq 0x4120
callq 0x4520
jmp 0x49a2b
jmp 0x49bb4
jmp 0x49bb4
jmp 0x49bb4
movq %rax, %rbx
movq %rsp, %rdi
callq 0x20984
movq %rbx, %rdi
callq 0x45e0
nop