- now the mess with threads has gone away
- we have a class BaseThread -- this is a base class -- we can inherit from it when creating a new thread - others treads are correctly stopped (when signal comes) -- pthread_join - we have a special thread only for signals git-svn-id: svn://ttmath.org/publicrep/winix/trunk@685 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -127,7 +127,7 @@ void CreateThread::MakePost()
|
||||
return;
|
||||
}
|
||||
|
||||
request->status = system->dirs.AddDirectory(request->item, true);
|
||||
request->status = system->dirs.AddDirectory(request->item, true, 0, WINIX_NOTIFY_CODE_THREAD_ADD);
|
||||
|
||||
if( request->status == WINIX_ERR_OK )
|
||||
{
|
||||
|
@@ -89,6 +89,29 @@ void Emacs::PostFunEmacsModifyMountPoint(bool adding)
|
||||
|
||||
|
||||
|
||||
|
||||
int Emacs::NotifyCodeEdit()
|
||||
{
|
||||
if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
|
||||
return WINIX_NOTIFY_CODE_THREAD_POST_CHANGED;
|
||||
|
||||
return WINIX_NOTIFY_CODE_FILE_EDIT;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int Emacs::NotifyCodeAdd()
|
||||
{
|
||||
if( system->mounts.pmount->type == system->mounts.MountTypeThread() )
|
||||
return WINIX_NOTIFY_CODE_THREAD_REPLAYED;
|
||||
|
||||
return WINIX_NOTIFY_CODE_FILE_ADD;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void Emacs::MakePost()
|
||||
{
|
||||
bool adding = !request->is_item;
|
||||
@@ -110,11 +133,11 @@ void Emacs::MakePost()
|
||||
request->is_item = true; // !! moze lepiej nie ustawiac is_item? (bo jak wystapi blad np dodania do bazy danych
|
||||
// to formularz edycji zmieni sie z 'dodaj' na 'edytuj'
|
||||
request->item.privileges = 0644; // !! tymczasowo, bedzie uzyte umask
|
||||
request->status = system->AddFile(request->item);
|
||||
request->status = system->AddFile(request->item, NotifyCodeAdd());
|
||||
}
|
||||
else
|
||||
{
|
||||
request->status = system->EditFile(request->item, request->item.url != old_url);
|
||||
request->status = system->EditFile(request->item, request->item.url != old_url, NotifyCodeEdit());
|
||||
}
|
||||
|
||||
|
||||
|
@@ -31,6 +31,8 @@ private:
|
||||
bool HasAccess(const Item & item); // !! takie funkcje to nie powinny byc skladowe modelu?
|
||||
bool PostEmacsCheckAbuse(bool adding);
|
||||
void PostFunEmacsModifyMountPoint(bool adding);
|
||||
int NotifyCodeEdit();
|
||||
int NotifyCodeAdd();
|
||||
|
||||
std::wstring old_url;
|
||||
};
|
||||
|
@@ -61,11 +61,6 @@ void FunctionBase::SetTemplates(Templates * ptemplates)
|
||||
templates = ptemplates;
|
||||
}
|
||||
|
||||
void FunctionBase::SetNotify(Notify * pnotify)
|
||||
{
|
||||
notify = pnotify;
|
||||
}
|
||||
|
||||
|
||||
void FunctionBase::Init()
|
||||
{
|
||||
|
@@ -17,7 +17,7 @@
|
||||
#include "core/request.h"
|
||||
#include "core/config.h"
|
||||
#include "core/system.h"
|
||||
#include "core/notify.h"
|
||||
#include "templatesnotify/notify.h"
|
||||
#include "utf8.h"
|
||||
|
||||
|
||||
@@ -52,7 +52,6 @@ public:
|
||||
void SetSystem(System * psystem);
|
||||
void SetFunctions(Functions * pfunctions);
|
||||
void SetTemplates(Templates * ptemplates);
|
||||
void SetNotify(Notify * pnotify);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -62,7 +61,6 @@ protected:
|
||||
System * system;
|
||||
Functions * functions;
|
||||
Templates * templates;
|
||||
Notify * notify;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -45,10 +45,6 @@ void Functions::SetTemplates(Templates * ptemplates)
|
||||
}
|
||||
|
||||
|
||||
void Functions::SetNotify(Notify * pnotify)
|
||||
{
|
||||
notify = pnotify;
|
||||
}
|
||||
|
||||
|
||||
size_t Functions::FunctionsSize()
|
||||
@@ -138,7 +134,6 @@ void Functions::SetObjects(FunctionBase * fun)
|
||||
fun->SetSystem(system);
|
||||
fun->SetFunctions(this);
|
||||
fun->SetTemplates(templates);
|
||||
fun->SetNotify(notify);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -105,7 +105,6 @@ public:
|
||||
void SetDb(Db * pdb);
|
||||
void SetSystem(System * psystem);
|
||||
void SetTemplates(Templates * ptemplates);
|
||||
void SetNotify(Notify * pnotify);
|
||||
|
||||
FunctionBase * Find(const std::wstring & function_name);
|
||||
Error CheckSpecialFile(const Item & item);
|
||||
@@ -139,7 +138,6 @@ private:
|
||||
Db * db;
|
||||
System * system;
|
||||
Templates * templates;
|
||||
Notify * notify;
|
||||
|
||||
std::wstring temp;
|
||||
HTMLFilter html_filter;
|
||||
|
@@ -27,7 +27,8 @@ void Reload::FunReloadTemplates()
|
||||
log << log1 << "Content: reloading html templates" << logend;
|
||||
|
||||
templates->ReadTemplates();
|
||||
notify->ReadTemplates(); // make sure that ReadTemplates() is using some kind of locking
|
||||
// reload notify after templates (notify uses locales from templates)
|
||||
system->notify.ReadTemplates();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user