From 3fe63651667d3b74c2f9c97824cb9ed65913a99e Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Thu, 19 Jan 2012 15:24:16 +0100 Subject: refactor: remove very old sync.[ch] system for "abstracting" mutex access This was a bad idea that never was used much. --- action.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'action.c') diff --git a/action.c b/action.c index a098eaae..b2620f6e 100644 --- a/action.c +++ b/action.c @@ -305,7 +305,7 @@ rsRetVal actionDestruct(action_t *pThis) if(pThis->f_pMsg != NULL) msgDestruct(&pThis->f_pMsg); - SYNC_OBJ_TOOL_EXIT(pThis); + pthread_mutex_destroy(&pThis->mutAction); pthread_mutex_destroy(&pThis->mutActExec); d_free(pThis->pszName); d_free(pThis->ppTpl); @@ -344,8 +344,8 @@ rsRetVal actionConstruct(action_t **ppThis) pThis->bRepMsgHasMsg = 0; pThis->tLastOccur = datetime.GetTime(NULL); /* done once per action on startup only */ pthread_mutex_init(&pThis->mutActExec, NULL); + pthread_mutex_init(&pThis->mutAction, NULL); INIT_ATOMIC_HELPER_MUT(pThis->mutCAS); - SYNC_OBJ_TOOL_INIT(pThis); /* indicate we have a new action */ ++iActionNbr; @@ -1800,10 +1800,10 @@ doSubmitToActionQComplexBatch(action_t *pAction, batch_t *pBatch) { DEFiRet; - LockObj(pAction); - pthread_cleanup_push(mutexCancelCleanup, pAction->Sync_mut); + d_pthread_mutex_lock(&pAction->mutAction); + pthread_cleanup_push(mutexCancelCleanup, &pAction->mutAction); iRet = helperSubmitToActionQComplexBatch(pAction, pBatch); - UnlockObj(pAction); + d_pthread_mutex_unlock(&pAction->mutAction); pthread_cleanup_pop(0); /* remove mutex cleanup handler */ RETiRet; -- cgit