From cf26f2ab2387147480baaf41a38c15ded9b77158 Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Wed, 14 Nov 2007 12:59:58 +0000 Subject: Introducing the workqueue --- ot_mutex.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'ot_mutex.h') diff --git a/ot_mutex.h b/ot_mutex.h index 2d30c69..31a16ef 100644 --- a/ot_mutex.h +++ b/ot_mutex.h @@ -4,6 +4,9 @@ #ifndef __OT_MUTEX_H__ #define __OT_MUTEX_H__ +#include "ot_iovec.h" +#include "io.h" + void mutex_init( ); void mutex_deinit( ); @@ -13,4 +16,19 @@ ot_vector *mutex_bucket_lock_by_hash( ot_hash *hash ); void mutex_bucket_unlock( int bucket ); void mutex_bucket_unlock_by_hash( ot_hash *hash ); +typedef enum { + OT_TASKTYPE_FULLSCRAPE, + OT_TASKTYPE_SYNC, + OT_TASKTYPE_DMEM, + + OT_TASKTYPE_DONE +} ot_tasktype; +typedef unsigned long ot_taskid; + +int mutex_workqueue_pushtask( int64 socket, ot_tasktype tasktype ); +void mutex_workqueue_canceltask( int64 socket ); +ot_taskid mutex_workqueue_poptask( ot_tasktype tasktype ); +int mutex_workqueue_pushresult( ot_taskid taskid, int iovec_entries, struct iovec *iovector ); +int64 mutex_workqueue_popresult( int *iovec_entries, struct iovec ** iovector ); + #endif -- cgit v1.2.3