version 1.1.2.7, 2013/12/05 15:56:10
|
version 1.1.2.8, 2013/12/05 16:57:08
|
Line 116 io_progOpen(prog_t * __restrict prg, u_int execNum)
|
Line 116 io_progOpen(prog_t * __restrict prg, u_int execNum)
|
|
|
if (!prg) |
if (!prg) |
return 0; |
return 0; |
if (execNum > prg->prog_maxn) { | if (prg->prog_cnum + execNum > prg->prog_maxn) { |
io_SetErr(EINVAL, "Requested number for program execution is over pool's limit"); |
io_SetErr(EINVAL, "Requested number for program execution is over pool's limit"); |
return 0; |
return 0; |
} |
} |
Line 142 io_progOpen(prog_t * __restrict prg, u_int execNum)
|
Line 142 io_progOpen(prog_t * __restrict prg, u_int execNum)
|
pthread_mutex_unlock(&prg->prog_mtx); |
pthread_mutex_unlock(&prg->prog_mtx); |
|
|
return ret; |
return ret; |
|
} |
|
|
|
/* |
|
* io_progGrow() - Execute to number of programs in pool |
|
* |
|
* @prg = program pool |
|
* @toNum = execute to number of programs (0 max) |
|
* return: 0 error, >0 executed programs and abs(<0) executed programs with logged error |
|
*/ |
|
int |
|
io_progGrow(prog_t * __restrict prg, u_int toNum) |
|
{ |
|
if (!prg) |
|
return 0; |
|
if (toNum > prg->prog_maxn) { |
|
io_SetErr(EINVAL, "Requested number for program execution is over pool's limit"); |
|
return 0; |
|
} |
|
if (!toNum) |
|
toNum = prg->prog_maxn; |
|
|
|
return io_progOpen(prg, toNum - prg->prog_cnum); |
} |
} |
|
|
/* |
/* |