diff options
Diffstat (limited to 'ot_mutex.c')
-rw-r--r-- | ot_mutex.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -32,6 +32,9 @@ static int bucket_locklist_count = 0; | |||
32 | static pthread_mutex_t bucket_mutex; | 32 | static pthread_mutex_t bucket_mutex; |
33 | static pthread_cond_t bucket_being_unlocked; | 33 | static pthread_cond_t bucket_being_unlocked; |
34 | 34 | ||
35 | /* Self pipe from opentracker.c */ | ||
36 | extern int g_self_pipe[2]; | ||
37 | |||
35 | static int bucket_check( int bucket ) { | 38 | static int bucket_check( int bucket ) { |
36 | /* C should come with auto-i ;) */ | 39 | /* C should come with auto-i ;) */ |
37 | int i; | 40 | int i; |
@@ -255,6 +258,8 @@ void mutex_workqueue_pushsuccess( ot_taskid taskid ) { | |||
255 | 258 | ||
256 | int mutex_workqueue_pushresult( ot_taskid taskid, int iovec_entries, struct iovec *iovec ) { | 259 | int mutex_workqueue_pushresult( ot_taskid taskid, int iovec_entries, struct iovec *iovec ) { |
257 | struct ot_task * task; | 260 | struct ot_task * task; |
261 | const char byte = 'o'; | ||
262 | |||
258 | /* Want exclusive access to tasklist */ | 263 | /* Want exclusive access to tasklist */ |
259 | MTX_DBG( "pushresult locks.\n" ); | 264 | MTX_DBG( "pushresult locks.\n" ); |
260 | pthread_mutex_lock( &tasklist_mutex ); | 265 | pthread_mutex_lock( &tasklist_mutex ); |
@@ -275,6 +280,8 @@ int mutex_workqueue_pushresult( ot_taskid taskid, int iovec_entries, struct iove | |||
275 | pthread_mutex_unlock( &tasklist_mutex ); | 280 | pthread_mutex_unlock( &tasklist_mutex ); |
276 | MTX_DBG( "pushresult unlocked.\n" ); | 281 | MTX_DBG( "pushresult unlocked.\n" ); |
277 | 282 | ||
283 | io_trywrite( g_self_pipe[1], &byte, 1 ); | ||
284 | |||
278 | /* Indicate whether the worker has to throw away results */ | 285 | /* Indicate whether the worker has to throw away results */ |
279 | return task ? 0 : -1; | 286 | return task ? 0 : -1; |
280 | } | 287 | } |