add task for writer thread
| 152 | |
| 153 | // add task for writer thread |
| 154 | int ThreadPools_AddWorkWriter |
| 155 | ( |
| 156 | void (*function_p)(void *), |
| 157 | void *arg_p, |
| 158 | int force |
| 159 | ) { |
| 160 | ASSERT(_writers_thpool != NULL); |
| 161 | |
| 162 | // make sure there's enough room in thread pool queue |
| 163 | if(thpool_queue_full(_writers_thpool) && !force) return THPOOL_QUEUE_FULL; |
| 164 | |
| 165 | return thpool_add_work(_writers_thpool, function_p, arg_p); |
| 166 | } |
| 167 | |
| 168 | void ThreadPools_SetMaxPendingWork(uint64_t val) { |
| 169 | if(_readers_thpool != NULL) thpool_set_jobqueue_cap(_readers_thpool, val); |