]> code.citadel.org Git - citadel.git/blobdiff - citadel/server/threads.c
Really just a commit test.
[citadel.git] / citadel / server / threads.c
index ed229c19e76443baaef2024bfa8f57032f1c4fd3..7fe9d5f38b9d7e98bbeaa088e9b74be2e27e1373 100644 (file)
@@ -33,17 +33,17 @@ void InitializeSemaphores(void) {
 
 
 // Obtain a semaphore lock to begin a critical section, but only if no one else has one
-int try_critical_section(int which_one) {
+//int try_critical_section(int which_one) {
        // For all types of critical sections except those listed here,
        // ensure nobody ever tries to do a critical section within a
        // transaction; this could lead to deadlock.
-       if (    (which_one != S_FLOORCACHE)
-               && (which_one != S_NETCONFIGS)
-       ) {
-               cdb_check_handles();
-       }
-       return (pthread_mutex_trylock(&Critters[which_one]));
-}
+       //if (  (which_one != S_FLOORCACHE)
+               //&& (which_one != S_NETCONFIGS)
+       //) {
+               //cdb_check_handles();
+       //}
+       //return (pthread_mutex_trylock(&Critters[which_one]));
+//}
 
 
 // Obtain a semaphore lock to begin a critical section.
@@ -51,28 +51,17 @@ void begin_critical_section(int which_one) {
        // For all types of critical sections except those listed here,
        // ensure nobody ever tries to do a critical section within a
        // transaction; this could lead to deadlock.
-       if (    (which_one != S_FLOORCACHE)
-               && (which_one != S_NETCONFIGS)
-       ) {
+       if ((which_one != S_FLOORCACHE) && (which_one != S_NETCONFIGS)) {
                cdb_check_handles();
        }
 
-       struct timeval t1,t2;
-       syslog(LOG_DEBUG, "\033[33mthreads: lock %d requested\033[0m", which_one);
-       gettimeofday(&t1, NULL);
-       long ms1 = (t1.tv_sec * 1000) + t1.tv_usec;
        pthread_mutex_lock(&Critters[which_one]);
-       gettimeofday(&t2, NULL);
-       long ms2 = (t2.tv_sec * 1000) + t2.tv_usec;
-       syslog(LOG_DEBUG, "\033[32mthreads: lock %d acquired in %ld milliseconds\033[0m", which_one, ms2-ms1);
-
 }
 
 
 // Release a semaphore lock to end a critical section.
 void end_critical_section(int which_one) {
        pthread_mutex_unlock(&Critters[which_one]);
-       syslog(LOG_DEBUG, "\033[31mthreads: lock %d released\033[0m", which_one);
 }