// --------------------------------------------------------------- //a therad which asynchronously save th registry entries // --------------------------------------------------------------- void AsyncSaveKeyBckgProc (void *param) { struct S_ini *pmsg; LL_Create (LL_ID_SETTINGS, 500); tThreads[TH_ASYNCSAVEKEY].bInit = TRUE; // inits OK do { WaitForSingleObject (tThreads[TH_ASYNCSAVEKEY].hEv, INFINITE); Sleep (10); for ( pmsg = LL_PopMsg (LL_ID_SETTINGS); pmsg != NULL ; pmsg = LL_PopMsg (LL_ID_SETTINGS) ) { SaveKey (pmsg->path, pmsg->key, pmsg->buf, pmsg->bufsize, pmsg->type, pmsg->inifile); DeleteMsg(pmsg); } ResetEvent ( tThreads[TH_ASYNCSAVEKEY].hEv ); } while ( tThreads[TH_ASYNCSAVEKEY].gRunning ); LL_Destroy (LL_ID_SETTINGS); LogToMonitor ("end of registry thread\n"); _endthread (); } // AsyncSaveKeyProc
void StopAsyncMessagingFacility (void) { void *p; // empties list and close it while ( (p=LL_PopMsg (LL_ID_MSG_TO_GUI)) != NULL ) free (p); LL_Destroy (LL_ID_MSG_TO_GUI); } // StopAsyncMessagingFacility