temporary logging for debug
authorArt Cancro <ajc@uncensored.citadel.org>
Wed, 20 Jul 2011 15:53:20 +0000 (11:53 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 21:38:22 +0000 (21:38 +0000)
webcit/context_loop.c

index f9238ab6aee14d3e97669d76932371eacdc9bc42..ebbd75efb92c9ccfd1cfeb353c01c20adb3d54c0 100644 (file)
@@ -194,6 +194,7 @@ wcsession *FindSession(wcsession **wclist, ParsedHttpHdrs *Hdr, pthread_mutex_t
                                 * also NOT CURRENTLY LOCKED.  This will cause the proper size pool
                                 * to be created.
                                 */
+                               syslog(LOG_DEBUG, "\033[32mREUSING A SESSION\033[0m");
                                TheSession = sptr;
                        }
                        break;
@@ -583,7 +584,11 @@ void context_loop(ParsedHttpHdrs *Hdr)
        /*
         * Bind to the session and perform the transaction
         */
-       CtdlLogResult(pthread_mutex_lock(&TheSession->SessionMutex));
+       if (pthread_mutex_lock(&TheSession->SessionMutex)) {
+               syslog(LOG_DEBUG, "\033[31mWAITING FOR SESSION LOCK\033[0m");
+               CtdlLogResult(pthread_mutex_lock(&TheSession->SessionMutex));
+       }
+
        pthread_setspecific(MyConKey, (void *)TheSession);
        
        TheSession->lastreq = time(NULL);                       /* log */