]> code.citadel.org Git - citadel.git/blobdiff - citadel/sysdep.c
Fixed a bug in the threading code that would prevent new threads starting.
[citadel.git] / citadel / sysdep.c
index b1415a4aba393824a4ed735002c5d3314e92689d..433f3467b1e8a659d566f168945917bbd174aa60 100644 (file)
@@ -550,7 +550,7 @@ void CtdlFillSystemContext(struct CitContext *context, char *name)
                context->user.usernum = get_new_user_number();
                CtdlLogPrintf(CTDL_DEBUG, "Upgrading system user \"%s\" from user number 0 to user number %d\n", context->user.fullname, context->user.usernum);
                /* add user to the database */
-               putuser(&(context->user));
+               CtdlPutUser(&(context->user));
                cdb_store(CDB_USERSBYNUMBER, &(context->user.usernum), sizeof(long), context->user.fullname, strlen(context->user.fullname)+1);
        }
 }
@@ -878,7 +878,6 @@ void sysdep_master_cleanup(void) {
        CtdlDestroySessionHooks();
        CtdlDestroyServiceHook();
        CtdlDestroyRoomHooks();
-       CtdlDestroyDirectoryServiceFuncs();
        #ifdef HAVE_BACKTRACE
        eCrash_Uninit();
        #endif
@@ -1009,14 +1008,15 @@ void checkcrash(void)
                        " The Citadel server process (citserver) terminated unexpectedly."
                        "\n \n"
                        " This could be the result of a bug in the server program, or some external "
-                       "factor.  You can obtain more information about this by enabling core dumps. "
-                       "For more information, please see: "
-                       "http://citadel.org/doku.php/faq:mastering_your_os:gdb#how.do.i.make.my.system.produce.core-files"
+                       "factor.\n \n"
+                       " You can obtain more information about this by enabling core dumps.\n \n"
+                       " For more information, please see:\n \n"
+                       " http://citadel.org/doku.php/faq:mastering_your_os:gdb#how.do.i.make.my.system.produce.core-files"
                        "\n \n"
                        " If you have already done this, the core dump is likely to be found at %score.%d\n"
                        ,
                        ctdl_run_dir, ForkedPid);
-               aide_message(ChrPtr(CrashMail), "Citadel server process terminated unexpectedly");
+               CtdlAideMessage(ChrPtr(CrashMail), "Citadel server process terminated unexpectedly");
                FreeStrBuf(&CrashMail);
        }
 }
@@ -1123,6 +1123,9 @@ void InitializeMasterCC(void) {
  * Bind a thread to a context.  (It's inline merely to speed things up.)
  */
 INLINE void become_session(struct CitContext *which_con) {
+       if (which_con)
+               ctdl_thread_internal_change_state(CT, CTDL_THREAD_RUNNING);
+
        citthread_setspecific(MyConKey, (void *)which_con );
 }