diff options
Diffstat (limited to 'ot_mutex.h')
| -rw-r--r-- | ot_mutex.h | 18 |
1 files changed, 18 insertions, 0 deletions
| @@ -4,6 +4,9 @@ | |||
| 4 | #ifndef __OT_MUTEX_H__ | 4 | #ifndef __OT_MUTEX_H__ |
| 5 | #define __OT_MUTEX_H__ | 5 | #define __OT_MUTEX_H__ |
| 6 | 6 | ||
| 7 | #include "ot_iovec.h" | ||
| 8 | #include "io.h" | ||
| 9 | |||
| 7 | void mutex_init( ); | 10 | void mutex_init( ); |
| 8 | void mutex_deinit( ); | 11 | void mutex_deinit( ); |
| 9 | 12 | ||
| @@ -13,4 +16,19 @@ ot_vector *mutex_bucket_lock_by_hash( ot_hash *hash ); | |||
| 13 | void mutex_bucket_unlock( int bucket ); | 16 | void mutex_bucket_unlock( int bucket ); |
| 14 | void mutex_bucket_unlock_by_hash( ot_hash *hash ); | 17 | void mutex_bucket_unlock_by_hash( ot_hash *hash ); |
| 15 | 18 | ||
| 19 | typedef enum { | ||
| 20 | OT_TASKTYPE_FULLSCRAPE, | ||
| 21 | OT_TASKTYPE_SYNC, | ||
| 22 | OT_TASKTYPE_DMEM, | ||
| 23 | |||
| 24 | OT_TASKTYPE_DONE | ||
| 25 | } ot_tasktype; | ||
| 26 | typedef unsigned long ot_taskid; | ||
| 27 | |||
| 28 | int mutex_workqueue_pushtask( int64 socket, ot_tasktype tasktype ); | ||
| 29 | void mutex_workqueue_canceltask( int64 socket ); | ||
| 30 | ot_taskid mutex_workqueue_poptask( ot_tasktype tasktype ); | ||
| 31 | int mutex_workqueue_pushresult( ot_taskid taskid, int iovec_entries, struct iovec *iovector ); | ||
| 32 | int64 mutex_workqueue_popresult( int *iovec_entries, struct iovec ** iovector ); | ||
| 33 | |||
| 16 | #endif | 34 | #endif |
