projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
05e1691
)
Wrap all calls to pthread_mutex_lock() and pthread_mutex_unlock() within CtdlLogResult()
author
Art Cancro
<ajc@uncensored.citadel.org>
Mon, 18 Jul 2011 20:21:29 +0000
(16:21 -0400)
committer
Art Cancro
<ajc@uncensored.citadel.org>
Mon, 18 Jul 2011 20:21:29 +0000
(16:21 -0400)
webcit/context_loop.c
patch
|
blob
|
history
diff --git
a/webcit/context_loop.c
b/webcit/context_loop.c
index 1baa06b0adbc345e5f193a0f5c6fb577b8d36966..f9238ab6aee14d3e97669d76932371eacdc9bc42 100644
(file)
--- a/
webcit/context_loop.c
+++ b/
webcit/context_loop.c
@@
-65,7
+65,7
@@
void do_housekeeping(void)
* Lock the session list, moving any candidates for euthanasia into
* a separate list.
*/
* Lock the session list, moving any candidates for euthanasia into
* a separate list.
*/
-
pthread_mutex_lock(&SessionListMutex
);
+
CtdlLogResult(pthread_mutex_lock(&SessionListMutex)
);
for (sptr = SessionList; sptr != NULL; sptr = sptr->next) {
/* Kill idle sessions */
for (sptr = SessionList; sptr != NULL; sptr = sptr->next) {
/* Kill idle sessions */
@@
-91,7
+91,7
@@
void do_housekeeping(void)
sessions_to_kill = sptr;
}
}
sessions_to_kill = sptr;
}
}
-
pthread_mutex_unlock(&SessionListMutex
);
+
CtdlLogResult(pthread_mutex_unlock(&SessionListMutex)
);
/*
* Now free up and destroy the culled sessions.
/*
* Now free up and destroy the culled sessions.
@@
-163,7
+163,7
@@
wcsession *FindSession(wcsession **wclist, ParsedHttpHdrs *Hdr, pthread_mutex_t
GetAuthBasic(Hdr);
}
GetAuthBasic(Hdr);
}
-
pthread_mutex_lock(ListMutex
);
+
CtdlLogResult(pthread_mutex_lock(ListMutex)
);
for (sptr = *wclist; ((sptr != NULL) && (TheSession == NULL)); sptr = sptr->next) {
/* If HTTP-AUTH, look for a session with matching credentials */
for (sptr = *wclist; ((sptr != NULL) && (TheSession == NULL)); sptr = sptr->next) {
/* If HTTP-AUTH, look for a session with matching credentials */
@@
-199,7
+199,7
@@
wcsession *FindSession(wcsession **wclist, ParsedHttpHdrs *Hdr, pthread_mutex_t
break;
}
}
break;
}
}
-
pthread_mutex_unlock(ListMutex
);
+
CtdlLogResult(pthread_mutex_unlock(ListMutex)
);
if (TheSession == NULL)
syslog(1, "didn't find sessionkey [%d] for user [%s]\n",
Hdr->HR.SessionKey, ChrPtr(Hdr->c_username));
if (TheSession == NULL)
syslog(1, "didn't find sessionkey [%d] for user [%s]\n",
Hdr->HR.SessionKey, ChrPtr(Hdr->c_username));
@@
-238,7
+238,7
@@
wcsession *CreateSession(int Lockable, int Static, wcsession **wclist, ParsedHtt
pthread_mutex_init(&TheSession->SessionMutex, NULL);
if (ListMutex != NULL)
pthread_mutex_init(&TheSession->SessionMutex, NULL);
if (ListMutex != NULL)
-
pthread_mutex_lock(ListMutex
);
+
CtdlLogResult(pthread_mutex_lock(ListMutex)
);
if (wclist != NULL) {
TheSession->nonce = rand();
if (wclist != NULL) {
TheSession->nonce = rand();
@@
-246,7
+246,7
@@
wcsession *CreateSession(int Lockable, int Static, wcsession **wclist, ParsedHtt
*wclist = TheSession;
}
if (ListMutex != NULL)
*wclist = TheSession;
}
if (ListMutex != NULL)
-
pthread_mutex_unlock(ListMutex
);
+
CtdlLogResult(pthread_mutex_unlock(ListMutex)
);
}
return TheSession;
}
}
return TheSession;
}
@@
-583,7
+583,7
@@
void context_loop(ParsedHttpHdrs *Hdr)
/*
* Bind to the session and perform the transaction
*/
/*
* Bind to the session and perform the transaction
*/
- pthread_mutex_lock(&TheSession->SessionMutex); /* bind */
+ CtdlLogResult(pthread_mutex_lock(&TheSession->SessionMutex));
pthread_setspecific(MyConKey, (void *)TheSession);
TheSession->lastreq = time(NULL); /* log */
pthread_setspecific(MyConKey, (void *)TheSession);
TheSession->lastreq = time(NULL); /* log */
@@
-617,7
+617,7
@@
void context_loop(ParsedHttpHdrs *Hdr)
}
TheSession->Hdr = NULL;
}
TheSession->Hdr = NULL;
- pthread_mutex_unlock(&TheSession->SessionMutex); /* unbind */
+ CtdlLogResult(pthread_mutex_unlock(&TheSession->SessionMutex));
}
void tmplput_nonce(StrBuf *Target, WCTemplputParams *TP)
}
void tmplput_nonce(StrBuf *Target, WCTemplputParams *TP)