summaryrefslogtreecommitdiff
path: root/ot_mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'ot_mutex.c')
-rw-r--r--ot_mutex.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/ot_mutex.c b/ot_mutex.c
index 15f3da5..174c4ca 100644
--- a/ot_mutex.c
+++ b/ot_mutex.c
@@ -205,14 +205,12 @@ int mutex_workqueue_pushchunked(ot_taskid taskid, struct iovec *iovec) {
205 for (task = tasklist; task; task = task->next) 205 for (task = tasklist; task; task = task->next)
206 if (task->taskid == taskid) { 206 if (task->taskid == taskid) {
207 if( iovec ) { 207 if( iovec ) {
208fprintf(stderr, "mutex_workqueue_pushchunked pushing on taskid %lu\n", taskid); 208 if (iovec_append(&task->iovec_entries, &task->iovec, iovec) )
209 if (!iovec_append(&task->iovec_entries, &task->iovec, iovec) ) 209 task->tasktype = TASK_DONE_PARTIAL;
210 return -1; 210 else
211 task->tasktype = TASK_DONE_PARTIAL; 211 task = NULL;
212 } else { 212 } else
213fprintf(stderr, "mutex_workqueue_pushchunked finished taskid %lu\n", taskid);
214 task->tasktype = TASK_DONE; 213 task->tasktype = TASK_DONE;
215 }
216 break; 214 break;
217 } 215 }
218 216
@@ -220,8 +218,6 @@ fprintf(stderr, "mutex_workqueue_pushchunked finished taskid %lu\n", taskid);
220 pthread_mutex_unlock( &tasklist_mutex ); 218 pthread_mutex_unlock( &tasklist_mutex );
221 219
222 io_trywrite( g_self_pipe[1], &byte, 1 ); 220 io_trywrite( g_self_pipe[1], &byte, 1 );
223if(!task)
224fprintf(stderr, "mutex_workqueue_pushchunked taskid %lu not found\n", taskid);
225 221
226 /* Indicate whether the worker has to throw away results */ 222 /* Indicate whether the worker has to throw away results */
227 return task ? 0 : -1; 223 return task ? 0 : -1;
@@ -240,7 +236,6 @@ int64 mutex_workqueue_popresult( int *iovec_entries, struct iovec ** iovec, int
240 for (task = &tasklist; *task; task = &((*task)->next)) 236 for (task = &tasklist; *task; task = &((*task)->next))
241 if (((*task)->tasktype & TASK_CLASS_MASK ) == TASK_DONE) { 237 if (((*task)->tasktype & TASK_CLASS_MASK ) == TASK_DONE) {
242 struct ot_task *ptask = *task; 238 struct ot_task *ptask = *task;
243fprintf(stderr, "Got task %lu type %d with %d entries\n", (*task)->taskid, (*task)->tasktype, ptask->iovec_entries);
244 *iovec_entries = ptask->iovec_entries; 239 *iovec_entries = ptask->iovec_entries;
245 *iovec = ptask->iovec; 240 *iovec = ptask->iovec;
246 sock = ptask->sock; 241 sock = ptask->sock;