adds a read task
| 137 | |
| 138 | // adds a read task |
| 139 | int ThreadPools_AddWorkReader |
| 140 | ( |
| 141 | void (*function_p)(void *), // function to run |
| 142 | void *arg_p, // function arguments |
| 143 | int force // true will add task even if internal queue is full |
| 144 | ) { |
| 145 | ASSERT(_readers_thpool != NULL); |
| 146 | |
| 147 | // make sure there's enough room in thread pool queue |
| 148 | if(!force && thpool_queue_full(_readers_thpool)) return THPOOL_QUEUE_FULL; |
| 149 | |
| 150 | return thpool_add_work(_readers_thpool, function_p, arg_p); |
| 151 | } |
| 152 | |
| 153 | // add task for writer thread |
| 154 | int ThreadPools_AddWorkWriter |