fixed: ThreadMenager should use Lock/Unlock in StartAll() method
added: Job class (system->job object)
a general mechanism for jobs (by using PT::Space as a job structure)
WINIX_JOB plugin message will be sent with a pointer to PT::Space
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@829 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
+195
-150
@@ -2,29 +2,30 @@
|
||||
|
||||
acceptbaseparser.o: acceptbaseparser.h
|
||||
app.o: app.h config.h ../../pikotools/confparser/confparser.h
|
||||
app.o: ../../pikotools/confparser/space.h htmlfilter.h system.h dirs.h item.h
|
||||
app.o: ../../pikotools/confparser/space.h dircontainer.h ../db/db.h
|
||||
app.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
app.o: ../core/textstream.h misc.h requesttypes.h ../core/error.h
|
||||
app.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
app.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
app.o: ../core/ugcontainer.h log.h textstream.h logmanipulators.h slog.h
|
||||
app.o: cur.h request.h error.h ../templates/htmltextstream.h session.h user.h
|
||||
app.o: plugindata.h rebus.h mount.h ../templates/locale.h ../notify/notify.h
|
||||
app.o: ../../pikotools/confparser/space.h htmlfilter.h system.h job.h
|
||||
app.o: basethread.h synchro.h ../../pikotools/confparser/space.h dirs.h
|
||||
app.o: item.h dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
app.o: ../db/dbtextstream.h ../core/textstream.h misc.h requesttypes.h
|
||||
app.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
||||
app.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
app.o: ../core/dircontainer.h ../core/ugcontainer.h log.h textstream.h
|
||||
app.o: logmanipulators.h slog.h cur.h request.h error.h
|
||||
app.o: ../templates/htmltextstream.h session.h user.h plugindata.h rebus.h
|
||||
app.o: mount.h ../templates/locale.h ../notify/notify.h
|
||||
app.o: ../notify/notifypool.h ../templates/patterns.h ../templates/locale.h
|
||||
app.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
app.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
app.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
app.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.h
|
||||
app.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
app.o: ../notify/notifythread.h ../core/basethread.h
|
||||
app.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
app.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h run.h
|
||||
app.o: users.h groups.h group.h loadavg.h image.h basethread.h
|
||||
app.o: threadmanager.h sessionmanager.h sessioncontainer.h
|
||||
app.o: ../functions/functions.h ../functions/functionbase.h ../core/request.h
|
||||
app.o: ../core/system.h ../core/synchro.h ../functions/functionparser.h
|
||||
app.o: ../core/cur.h ../functions/adduser.h ../functions/cat.h
|
||||
app.o: ../functions/chmod.h ../functions/privchanger.h ../functions/chown.h
|
||||
app.o: users.h groups.h group.h loadavg.h image.h threadmanager.h
|
||||
app.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
|
||||
app.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
app.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
||||
app.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
app.o: ../functions/privchanger.h ../functions/chown.h
|
||||
app.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
||||
app.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
||||
app.o: ../functions/last.h ../functions/login.h ../functions/logout.h
|
||||
@@ -43,7 +44,7 @@ app.o: ../templates/changepatterns.h ../templates/htmltextstream.h
|
||||
app.o: ../core/sessionmanager.h compress.h postparser.h httpsimpleparser.h
|
||||
app.o: cookieparser.h postmultiparser.h acceptencodingparser.h
|
||||
app.o: acceptbaseparser.h plugin.h pluginmsg.h
|
||||
basethread.o: basethread.h
|
||||
basethread.o: basethread.h synchro.h
|
||||
bbcodeparser.o: bbcodeparser.h htmlfilter.h
|
||||
compress.o: compress.h log.h textstream.h logmanipulators.h slog.h cur.h
|
||||
compress.o: request.h requesttypes.h item.h
|
||||
@@ -59,21 +60,21 @@ config.o: logmanipulators.h slog.h cur.h request.h requesttypes.h item.h
|
||||
config.o: ../../pikotools/confparser/space.h error.h
|
||||
config.o: ../templates/htmltextstream.h ../core/textstream.h misc.h session.h
|
||||
config.o: user.h plugindata.h rebus.h mount.h ../templates/locale.h plugin.h
|
||||
config.o: pluginmsg.h system.h dirs.h dircontainer.h ../db/db.h
|
||||
config.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
||||
config.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
config.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
config.o: ../core/ugcontainer.h ../notify/notify.h ../notify/notifypool.h
|
||||
config.o: ../templates/patterns.h ../templates/locale.h
|
||||
config.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
config.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
config.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
config.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.h
|
||||
config.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
config.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
config.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h run.h
|
||||
config.o: users.h groups.h group.h loadavg.h image.h basethread.h
|
||||
config.o: threadmanager.h sessionmanager.h sessioncontainer.h
|
||||
config.o: pluginmsg.h system.h job.h basethread.h synchro.h dirs.h
|
||||
config.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
config.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
||||
config.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
config.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
||||
config.o: ../notify/notifypool.h ../templates/patterns.h
|
||||
config.o: ../templates/locale.h ../templates/localefilter.h
|
||||
config.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
||||
config.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
config.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
config.o: ../../pikotools/utf8/utf8.h ../notify/notifythread.h
|
||||
config.o: ../core/basethread.h ../notify/templatesnotify.h ../core/config.h
|
||||
config.o: ../core/users.h ugcontainer.h lastcontainer.h mounts.h
|
||||
config.o: mountparser.h crypt.h run.h users.h groups.h group.h loadavg.h
|
||||
config.o: image.h threadmanager.h sessionmanager.h sessioncontainer.h
|
||||
config.o: ../functions/functions.h ../functions/functionbase.h
|
||||
config.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
config.o: ../functions/functionparser.h ../core/cur.h ../functions/adduser.h
|
||||
@@ -124,7 +125,7 @@ dirs.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
dirs.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
dirs.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
dirs.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.h
|
||||
dirs.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
dirs.o: ../notify/notifythread.h ../core/basethread.h
|
||||
dirs.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
dirs.o: ugcontainer.h lastcontainer.h
|
||||
groups.o: groups.h group.h ugcontainer.h ../db/db.h ../db/dbbase.h
|
||||
@@ -139,23 +140,24 @@ groups.o: htmlfilter.h ../templates/htmltextstream.h session.h user.h
|
||||
groups.o: plugindata.h rebus.h mount.h ../templates/locale.h
|
||||
htmlfilter.o: htmlfilter.h
|
||||
httpsimpleparser.o: httpsimpleparser.h
|
||||
image.o: image.h basethread.h textstream.h ../db/db.h ../db/dbbase.h
|
||||
image.o: ../db/dbconn.h ../db/dbtextstream.h ../core/textstream.h misc.h
|
||||
image.o: item.h ../../pikotools/confparser/space.h requesttypes.h
|
||||
image.o: ../core/error.h ../../pikotools/confparser/confparser.h
|
||||
image.o: image.h basethread.h synchro.h textstream.h ../db/db.h
|
||||
image.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
image.o: ../core/textstream.h misc.h item.h
|
||||
image.o: ../../pikotools/confparser/space.h requesttypes.h ../core/error.h
|
||||
image.o: ../../pikotools/confparser/confparser.h
|
||||
image.o: ../../pikotools/confparser/space.h ../db/dbitemquery.h
|
||||
image.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
image.o: ../core/dircontainer.h ../core/ugcontainer.h log.h logmanipulators.h
|
||||
image.o: slog.h cur.h request.h error.h config.h htmlfilter.h
|
||||
image.o: ../templates/htmltextstream.h session.h user.h plugindata.h rebus.h
|
||||
image.o: mount.h ../templates/locale.h ../core/config.h
|
||||
image.o: ../../pikotools/utf8/utf8.h system.h dirs.h dircontainer.h
|
||||
image.o: ../../pikotools/utf8/utf8.h system.h job.h dirs.h dircontainer.h
|
||||
image.o: ../notify/notify.h ../notify/notifypool.h ../templates/patterns.h
|
||||
image.o: ../templates/locale.h ../templates/localefilter.h
|
||||
image.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
||||
image.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
image.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
image.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
image.o: ../notify/notifythread.h ../core/basethread.h
|
||||
image.o: ../notify/templatesnotify.h ../core/users.h ugcontainer.h
|
||||
image.o: lastcontainer.h mounts.h mountparser.h crypt.h run.h users.h
|
||||
image.o: groups.h group.h loadavg.h threadmanager.h plugin.h pluginmsg.h
|
||||
@@ -183,6 +185,47 @@ image.o: ../templates/htmltextstream.h ../core/sessionmanager.h
|
||||
item.o: item.h ../../pikotools/confparser/space.h misc.h requesttypes.h
|
||||
item.o: crypt.h run.h config.h ../../pikotools/confparser/confparser.h
|
||||
item.o: ../../pikotools/confparser/space.h htmlfilter.h user.h
|
||||
job.o: job.h basethread.h synchro.h ../../pikotools/confparser/space.h
|
||||
job.o: plugin.h pluginmsg.h log.h textstream.h logmanipulators.h slog.h cur.h
|
||||
job.o: request.h requesttypes.h item.h error.h config.h
|
||||
job.o: ../../pikotools/confparser/confparser.h
|
||||
job.o: ../../pikotools/confparser/space.h htmlfilter.h
|
||||
job.o: ../templates/htmltextstream.h ../core/textstream.h misc.h session.h
|
||||
job.o: user.h plugindata.h rebus.h mount.h ../templates/locale.h system.h
|
||||
job.o: dirs.h dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
job.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
||||
job.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
job.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
||||
job.o: ../notify/notifypool.h ../templates/patterns.h ../templates/locale.h
|
||||
job.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
job.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
job.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
job.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.h
|
||||
job.o: ../notify/notifythread.h ../core/basethread.h
|
||||
job.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
job.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h run.h
|
||||
job.o: users.h groups.h group.h loadavg.h image.h threadmanager.h
|
||||
job.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
|
||||
job.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
job.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
||||
job.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
job.o: ../functions/privchanger.h ../functions/chown.h
|
||||
job.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
||||
job.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
||||
job.o: ../functions/last.h ../functions/login.h ../functions/logout.h
|
||||
job.o: ../functions/ln.h ../functions/ls.h ../functions/man.h
|
||||
job.o: ../functions/meta.h ../functions/mkdir.h ../functions/mv.h
|
||||
job.o: ../functions/nicedit.h ../functions/node.h ../functions/passwd.h
|
||||
job.o: ../functions/priv.h ../functions/pw.h ../functions/reload.h
|
||||
job.o: ../functions/rm.h ../functions/rmuser.h ../functions/sort.h
|
||||
job.o: ../functions/specialdefault.h ../functions/stat.h
|
||||
job.o: ../functions/subject.h ../functions/template.h ../functions/tinymce.h
|
||||
job.o: ../functions/uname.h ../functions/upload.h ../functions/uptime.h
|
||||
job.o: ../functions/who.h ../functions/vim.h ../core/htmlfilter.h
|
||||
job.o: ../templates/templates.h ../templates/patterncacher.h
|
||||
job.o: ../templates/indexpatterns.h ../templates/patterns.h
|
||||
job.o: ../templates/changepatterns.h ../templates/htmltextstream.h
|
||||
job.o: ../core/sessionmanager.h
|
||||
lastcontainer.o: lastcontainer.h log.h textstream.h logmanipulators.h slog.h
|
||||
lastcontainer.o: cur.h request.h requesttypes.h item.h
|
||||
lastcontainer.o: ../../pikotools/confparser/space.h error.h config.h
|
||||
@@ -243,7 +286,7 @@ mountparser.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
mountparser.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
mountparser.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
mountparser.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.h
|
||||
mountparser.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
mountparser.o: ../notify/notifythread.h ../core/basethread.h
|
||||
mountparser.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
mountparser.o: ugcontainer.h lastcontainer.h
|
||||
mounts.o: mounts.h mount.h error.h dirs.h item.h
|
||||
@@ -262,25 +305,26 @@ mounts.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
mounts.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
mounts.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
mounts.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.h
|
||||
mounts.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
mounts.o: ../notify/notifythread.h ../core/basethread.h
|
||||
mounts.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
mounts.o: ugcontainer.h lastcontainer.h mountparser.h plugin.h pluginmsg.h
|
||||
mounts.o: system.h crypt.h run.h users.h groups.h group.h loadavg.h image.h
|
||||
mounts.o: basethread.h threadmanager.h sessionmanager.h sessioncontainer.h
|
||||
mounts.o: ../functions/functions.h ../functions/functionbase.h
|
||||
mounts.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
mounts.o: ../functions/functionparser.h ../core/cur.h ../functions/adduser.h
|
||||
mounts.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
|
||||
mounts.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
|
||||
mounts.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
|
||||
mounts.o: ../functions/env.h ../functions/last.h ../functions/login.h
|
||||
mounts.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
|
||||
mounts.o: ../functions/man.h ../functions/meta.h ../functions/mkdir.h
|
||||
mounts.o: ../functions/mv.h ../functions/nicedit.h ../functions/node.h
|
||||
mounts.o: ../functions/passwd.h ../functions/priv.h ../functions/pw.h
|
||||
mounts.o: ../functions/reload.h ../functions/rm.h ../functions/rmuser.h
|
||||
mounts.o: ../functions/sort.h ../functions/specialdefault.h
|
||||
mounts.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
||||
mounts.o: system.h job.h basethread.h synchro.h crypt.h run.h users.h
|
||||
mounts.o: groups.h group.h loadavg.h image.h threadmanager.h sessionmanager.h
|
||||
mounts.o: sessioncontainer.h ../functions/functions.h
|
||||
mounts.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
mounts.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
||||
mounts.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
mounts.o: ../functions/privchanger.h ../functions/chown.h
|
||||
mounts.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
||||
mounts.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
||||
mounts.o: ../functions/last.h ../functions/login.h ../functions/logout.h
|
||||
mounts.o: ../functions/ln.h ../functions/ls.h ../functions/man.h
|
||||
mounts.o: ../functions/meta.h ../functions/mkdir.h ../functions/mv.h
|
||||
mounts.o: ../functions/nicedit.h ../functions/node.h ../functions/passwd.h
|
||||
mounts.o: ../functions/priv.h ../functions/pw.h ../functions/reload.h
|
||||
mounts.o: ../functions/rm.h ../functions/rmuser.h ../functions/sort.h
|
||||
mounts.o: ../functions/specialdefault.h ../functions/stat.h
|
||||
mounts.o: ../functions/subject.h ../functions/template.h
|
||||
mounts.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
||||
mounts.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
||||
mounts.o: ../core/htmlfilter.h ../templates/templates.h
|
||||
@@ -294,21 +338,21 @@ plugin.o: ../../pikotools/confparser/confparser.h
|
||||
plugin.o: ../../pikotools/confparser/space.h htmlfilter.h
|
||||
plugin.o: ../templates/htmltextstream.h ../core/textstream.h misc.h session.h
|
||||
plugin.o: user.h plugindata.h rebus.h mount.h ../templates/locale.h system.h
|
||||
plugin.o: dirs.h dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
plugin.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
||||
plugin.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
plugin.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
||||
plugin.o: ../notify/notifypool.h ../templates/patterns.h
|
||||
plugin.o: ../templates/locale.h ../templates/localefilter.h
|
||||
plugin.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
||||
plugin.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
plugin.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
plugin.o: ../../pikotools/utf8/utf8.h ../notify/notifythread.h
|
||||
plugin.o: ../core/basethread.h synchro.h ../notify/templatesnotify.h
|
||||
plugin.o: ../core/config.h ../core/users.h ugcontainer.h lastcontainer.h
|
||||
plugin.o: mounts.h mountparser.h crypt.h run.h users.h groups.h group.h
|
||||
plugin.o: loadavg.h image.h basethread.h threadmanager.h sessionmanager.h
|
||||
plugin.o: sessioncontainer.h ../functions/functions.h
|
||||
plugin.o: job.h basethread.h synchro.h dirs.h dircontainer.h ../db/db.h
|
||||
plugin.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
||||
plugin.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
plugin.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
plugin.o: ../core/ugcontainer.h ../notify/notify.h ../notify/notifypool.h
|
||||
plugin.o: ../templates/patterns.h ../templates/locale.h
|
||||
plugin.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
plugin.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
plugin.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
plugin.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.h
|
||||
plugin.o: ../notify/notifythread.h ../core/basethread.h
|
||||
plugin.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
plugin.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h run.h
|
||||
plugin.o: users.h groups.h group.h loadavg.h image.h threadmanager.h
|
||||
plugin.o: sessionmanager.h sessioncontainer.h ../functions/functions.h
|
||||
plugin.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
plugin.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
||||
plugin.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
@@ -336,24 +380,24 @@ plugindata.o: ../../pikotools/confparser/confparser.h
|
||||
plugindata.o: ../../pikotools/confparser/space.h htmlfilter.h
|
||||
plugindata.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
plugindata.o: session.h user.h rebus.h mount.h ../templates/locale.h system.h
|
||||
plugindata.o: dirs.h dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
plugindata.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
||||
plugindata.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h
|
||||
plugindata.o: ../core/group.h ../core/dircontainer.h ../core/ugcontainer.h
|
||||
plugindata.o: ../notify/notify.h ../notify/notifypool.h
|
||||
plugindata.o: ../templates/patterns.h ../templates/locale.h
|
||||
plugindata.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
plugindata.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
plugindata.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
plugindata.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.h
|
||||
plugindata.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
plugindata.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
plugindata.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h
|
||||
plugindata.o: run.h users.h groups.h group.h loadavg.h image.h basethread.h
|
||||
plugindata.o: threadmanager.h sessionmanager.h sessioncontainer.h
|
||||
plugindata.o: ../functions/functions.h ../functions/functionbase.h
|
||||
plugindata.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
plugindata.o: ../functions/functionparser.h ../core/cur.h
|
||||
plugindata.o: job.h basethread.h synchro.h dirs.h dircontainer.h ../db/db.h
|
||||
plugindata.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
plugindata.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
||||
plugindata.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
plugindata.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
||||
plugindata.o: ../notify/notifypool.h ../templates/patterns.h
|
||||
plugindata.o: ../templates/locale.h ../templates/localefilter.h
|
||||
plugindata.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
||||
plugindata.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
plugindata.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
plugindata.o: ../../pikotools/utf8/utf8.h ../notify/notifythread.h
|
||||
plugindata.o: ../core/basethread.h ../notify/templatesnotify.h
|
||||
plugindata.o: ../core/config.h ../core/users.h ugcontainer.h lastcontainer.h
|
||||
plugindata.o: mounts.h mountparser.h crypt.h run.h users.h groups.h group.h
|
||||
plugindata.o: loadavg.h image.h threadmanager.h sessionmanager.h
|
||||
plugindata.o: sessioncontainer.h ../functions/functions.h
|
||||
plugindata.o: ../functions/functionbase.h ../core/request.h ../core/system.h
|
||||
plugindata.o: ../core/synchro.h ../functions/functionparser.h ../core/cur.h
|
||||
plugindata.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
plugindata.o: ../functions/privchanger.h ../functions/chown.h
|
||||
plugindata.o: ../functions/ckeditor.h ../functions/cp.h
|
||||
@@ -394,21 +438,21 @@ request.o: ../../pikotools/confparser/space.h htmlfilter.h textstream.h
|
||||
request.o: ../templates/htmltextstream.h ../core/textstream.h misc.h log.h
|
||||
request.o: logmanipulators.h slog.h cur.h session.h user.h plugindata.h
|
||||
request.o: rebus.h mount.h ../templates/locale.h plugin.h pluginmsg.h
|
||||
request.o: system.h dirs.h dircontainer.h ../db/db.h ../db/dbbase.h
|
||||
request.o: ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
||||
request.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
request.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
request.o: ../core/ugcontainer.h ../notify/notify.h ../notify/notifypool.h
|
||||
request.o: ../templates/patterns.h ../templates/locale.h
|
||||
request.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
request.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
request.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
request.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.h
|
||||
request.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
request.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
request.o: ugcontainer.h lastcontainer.h mounts.h mountparser.h crypt.h run.h
|
||||
request.o: users.h groups.h group.h loadavg.h image.h basethread.h
|
||||
request.o: threadmanager.h sessionmanager.h sessioncontainer.h
|
||||
request.o: system.h job.h basethread.h synchro.h dirs.h dircontainer.h
|
||||
request.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
request.o: ../core/error.h ../db/dbitemquery.h ../core/item.h
|
||||
request.o: ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
request.o: ../core/dircontainer.h ../core/ugcontainer.h ../notify/notify.h
|
||||
request.o: ../notify/notifypool.h ../templates/patterns.h
|
||||
request.o: ../templates/locale.h ../templates/localefilter.h
|
||||
request.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
||||
request.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
request.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
request.o: ../../pikotools/utf8/utf8.h ../notify/notifythread.h
|
||||
request.o: ../core/basethread.h ../notify/templatesnotify.h ../core/config.h
|
||||
request.o: ../core/users.h ugcontainer.h lastcontainer.h mounts.h
|
||||
request.o: mountparser.h crypt.h run.h users.h groups.h group.h loadavg.h
|
||||
request.o: image.h threadmanager.h sessionmanager.h sessioncontainer.h
|
||||
request.o: ../functions/functions.h ../functions/functionbase.h
|
||||
request.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
request.o: ../functions/functionparser.h ../core/cur.h ../functions/adduser.h
|
||||
@@ -454,11 +498,11 @@ sessionmanager.o: requesttypes.h config.h
|
||||
sessionmanager.o: ../../pikotools/confparser/confparser.h
|
||||
sessionmanager.o: ../../pikotools/confparser/space.h htmlfilter.h
|
||||
sessionmanager.o: ../templates/htmltextstream.h ../core/textstream.h misc.h
|
||||
sessionmanager.o: mount.h lastcontainer.h system.h dirs.h dircontainer.h
|
||||
sessionmanager.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
sessionmanager.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
||||
sessionmanager.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h
|
||||
sessionmanager.o: ../core/group.h ../core/dircontainer.h
|
||||
sessionmanager.o: mount.h lastcontainer.h system.h job.h basethread.h
|
||||
sessionmanager.o: synchro.h dirs.h dircontainer.h ../db/db.h ../db/dbbase.h
|
||||
sessionmanager.o: ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
||||
sessionmanager.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
sessionmanager.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
sessionmanager.o: ../core/ugcontainer.h log.h logmanipulators.h slog.h
|
||||
sessionmanager.o: ../templates/locale.h ../notify/notify.h
|
||||
sessionmanager.o: ../notify/notifypool.h ../templates/patterns.h
|
||||
@@ -467,13 +511,13 @@ sessionmanager.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
||||
sessionmanager.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
sessionmanager.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
sessionmanager.o: ../../pikotools/utf8/utf8.h ../notify/notifythread.h
|
||||
sessionmanager.o: ../core/basethread.h synchro.h ../notify/templatesnotify.h
|
||||
sessionmanager.o: ../core/basethread.h ../notify/templatesnotify.h
|
||||
sessionmanager.o: ../core/config.h ../core/users.h ugcontainer.h mounts.h
|
||||
sessionmanager.o: mountparser.h crypt.h run.h users.h groups.h group.h
|
||||
sessionmanager.o: loadavg.h image.h basethread.h threadmanager.h
|
||||
sessionmanager.o: sessionparser.h plugin.h pluginmsg.h
|
||||
sessionmanager.o: ../functions/functions.h ../functions/functionbase.h
|
||||
sessionmanager.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
sessionmanager.o: loadavg.h image.h threadmanager.h sessionparser.h plugin.h
|
||||
sessionmanager.o: pluginmsg.h ../functions/functions.h
|
||||
sessionmanager.o: ../functions/functionbase.h ../core/request.h
|
||||
sessionmanager.o: ../core/system.h ../core/synchro.h
|
||||
sessionmanager.o: ../functions/functionparser.h ../core/cur.h
|
||||
sessionmanager.o: ../functions/adduser.h ../functions/cat.h
|
||||
sessionmanager.o: ../functions/chmod.h ../functions/privchanger.h
|
||||
@@ -513,10 +557,11 @@ slog.o: ../templates/htmltextstream.h ../core/textstream.h misc.h session.h
|
||||
slog.o: user.h plugindata.h rebus.h mount.h logmanipulators.h
|
||||
slog.o: ../templates/locale.h
|
||||
synchro.o: synchro.h
|
||||
system.o: system.h dirs.h item.h ../../pikotools/confparser/space.h
|
||||
system.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
system.o: ../db/dbtextstream.h ../core/textstream.h misc.h requesttypes.h
|
||||
system.o: ../core/error.h ../../pikotools/confparser/confparser.h
|
||||
system.o: system.h job.h basethread.h synchro.h
|
||||
system.o: ../../pikotools/confparser/space.h dirs.h item.h dircontainer.h
|
||||
system.o: ../db/db.h ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h
|
||||
system.o: ../core/textstream.h misc.h requesttypes.h ../core/error.h
|
||||
system.o: ../../pikotools/confparser/confparser.h
|
||||
system.o: ../../pikotools/confparser/space.h ../db/dbitemquery.h
|
||||
system.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
system.o: ../core/dircontainer.h ../core/ugcontainer.h log.h textstream.h
|
||||
@@ -529,28 +574,28 @@ system.o: ../../ezc/src/ezc.h ../../ezc/src/generator.h
|
||||
system.o: ../../ezc/src/pattern.h ../../ezc/src/functions.h
|
||||
system.o: ../../ezc/src/funinfo.h ../../ezc/src/stringconv.h
|
||||
system.o: ../../pikotools/utf8/utf8.h ../notify/notifythread.h
|
||||
system.o: ../core/basethread.h synchro.h ../notify/templatesnotify.h
|
||||
system.o: ../core/config.h ../core/users.h ugcontainer.h lastcontainer.h
|
||||
system.o: mounts.h mountparser.h crypt.h run.h users.h groups.h group.h
|
||||
system.o: loadavg.h image.h basethread.h threadmanager.h
|
||||
system.o: ../templates/templates.h ../templates/patterncacher.h
|
||||
system.o: ../templates/indexpatterns.h ../templates/patterns.h
|
||||
system.o: ../templates/changepatterns.h ../templates/htmltextstream.h
|
||||
system.o: ../core/cur.h ../core/system.h ../core/sessionmanager.h
|
||||
system.o: ../core/htmlfilter.h ../functions/functions.h
|
||||
system.o: ../functions/functionbase.h ../core/request.h ../core/synchro.h
|
||||
system.o: ../functions/functionparser.h ../functions/adduser.h
|
||||
system.o: ../functions/cat.h ../functions/chmod.h ../functions/privchanger.h
|
||||
system.o: ../functions/chown.h ../functions/ckeditor.h ../functions/cp.h
|
||||
system.o: ../functions/default.h ../functions/download.h ../functions/emacs.h
|
||||
system.o: ../functions/env.h ../functions/last.h ../functions/login.h
|
||||
system.o: ../functions/logout.h ../functions/ln.h ../functions/ls.h
|
||||
system.o: ../functions/man.h ../functions/meta.h ../functions/mkdir.h
|
||||
system.o: ../functions/mv.h ../functions/nicedit.h ../functions/node.h
|
||||
system.o: ../functions/passwd.h ../functions/priv.h ../functions/pw.h
|
||||
system.o: ../functions/reload.h ../functions/rm.h ../functions/rmuser.h
|
||||
system.o: ../functions/sort.h ../functions/specialdefault.h
|
||||
system.o: ../functions/stat.h ../functions/subject.h ../functions/template.h
|
||||
system.o: ../core/basethread.h ../notify/templatesnotify.h ../core/config.h
|
||||
system.o: ../core/users.h ugcontainer.h lastcontainer.h mounts.h
|
||||
system.o: mountparser.h crypt.h run.h users.h groups.h group.h loadavg.h
|
||||
system.o: image.h threadmanager.h ../templates/templates.h
|
||||
system.o: ../templates/patterncacher.h ../templates/indexpatterns.h
|
||||
system.o: ../templates/patterns.h ../templates/changepatterns.h
|
||||
system.o: ../templates/htmltextstream.h ../core/cur.h ../core/system.h
|
||||
system.o: ../core/sessionmanager.h ../core/htmlfilter.h
|
||||
system.o: ../functions/functions.h ../functions/functionbase.h
|
||||
system.o: ../core/request.h ../core/synchro.h ../functions/functionparser.h
|
||||
system.o: ../functions/adduser.h ../functions/cat.h ../functions/chmod.h
|
||||
system.o: ../functions/privchanger.h ../functions/chown.h
|
||||
system.o: ../functions/ckeditor.h ../functions/cp.h ../functions/default.h
|
||||
system.o: ../functions/download.h ../functions/emacs.h ../functions/env.h
|
||||
system.o: ../functions/last.h ../functions/login.h ../functions/logout.h
|
||||
system.o: ../functions/ln.h ../functions/ls.h ../functions/man.h
|
||||
system.o: ../functions/meta.h ../functions/mkdir.h ../functions/mv.h
|
||||
system.o: ../functions/nicedit.h ../functions/node.h ../functions/passwd.h
|
||||
system.o: ../functions/priv.h ../functions/pw.h ../functions/reload.h
|
||||
system.o: ../functions/rm.h ../functions/rmuser.h ../functions/sort.h
|
||||
system.o: ../functions/specialdefault.h ../functions/stat.h
|
||||
system.o: ../functions/subject.h ../functions/template.h
|
||||
system.o: ../functions/tinymce.h ../functions/uname.h ../functions/upload.h
|
||||
system.o: ../functions/uptime.h ../functions/who.h ../functions/vim.h
|
||||
system.o: plugin.h pluginmsg.h sessionmanager.h sessioncontainer.h
|
||||
@@ -570,21 +615,21 @@ users.o: rebus.h textstream.h cur.h request.h requesttypes.h config.h
|
||||
users.o: ../../pikotools/confparser/confparser.h
|
||||
users.o: ../../pikotools/confparser/space.h htmlfilter.h
|
||||
users.o: ../templates/htmltextstream.h ../core/textstream.h misc.h mount.h
|
||||
users.o: lastcontainer.h system.h dirs.h dircontainer.h ../db/db.h
|
||||
users.o: ../db/dbbase.h ../db/dbconn.h ../db/dbtextstream.h ../core/error.h
|
||||
users.o: ../db/dbitemquery.h ../core/item.h ../db/dbitemcolumns.h
|
||||
users.o: ../core/user.h ../core/group.h ../core/dircontainer.h
|
||||
users.o: ../core/ugcontainer.h log.h logmanipulators.h slog.h
|
||||
users.o: ../templates/locale.h ../notify/notify.h ../notify/notifypool.h
|
||||
users.o: ../templates/patterns.h ../templates/locale.h
|
||||
users.o: lastcontainer.h system.h job.h basethread.h synchro.h dirs.h
|
||||
users.o: dircontainer.h ../db/db.h ../db/dbbase.h ../db/dbconn.h
|
||||
users.o: ../db/dbtextstream.h ../core/error.h ../db/dbitemquery.h
|
||||
users.o: ../core/item.h ../db/dbitemcolumns.h ../core/user.h ../core/group.h
|
||||
users.o: ../core/dircontainer.h ../core/ugcontainer.h log.h logmanipulators.h
|
||||
users.o: slog.h ../templates/locale.h ../notify/notify.h
|
||||
users.o: ../notify/notifypool.h ../templates/patterns.h ../templates/locale.h
|
||||
users.o: ../templates/localefilter.h ../../ezc/src/ezc.h
|
||||
users.o: ../../ezc/src/generator.h ../../ezc/src/pattern.h
|
||||
users.o: ../../ezc/src/functions.h ../../ezc/src/funinfo.h
|
||||
users.o: ../../ezc/src/stringconv.h ../../pikotools/utf8/utf8.h
|
||||
users.o: ../notify/notifythread.h ../core/basethread.h synchro.h
|
||||
users.o: ../notify/notifythread.h ../core/basethread.h
|
||||
users.o: ../notify/templatesnotify.h ../core/config.h ../core/users.h
|
||||
users.o: ugcontainer.h mounts.h mountparser.h crypt.h run.h groups.h group.h
|
||||
users.o: loadavg.h image.h basethread.h threadmanager.h plugin.h pluginmsg.h
|
||||
users.o: loadavg.h image.h threadmanager.h plugin.h pluginmsg.h
|
||||
users.o: ../functions/functions.h ../functions/functionbase.h
|
||||
users.o: ../core/request.h ../core/system.h ../core/synchro.h
|
||||
users.o: ../functions/functionparser.h ../core/cur.h ../functions/adduser.h
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
o = acceptbaseparser.o app.o basethread.o bbcodeparser.o compress.o config.o crypt.o dircontainer.o dirs.o groups.o htmlfilter.o httpsimpleparser.o image.o item.o lastcontainer.o loadavg.o log.o misc.o mount.o mountparser.o mounts.o plugin.o plugindata.o postmultiparser.o rebus.o request.o run.o session.o sessioncontainer.o sessionmanager.o sessionparser.o slog.o synchro.o system.o textstream.o threadmanager.o users.o
|
||||
o = acceptbaseparser.o app.o basethread.o bbcodeparser.o compress.o config.o crypt.o dircontainer.o dirs.o groups.o htmlfilter.o httpsimpleparser.o image.o item.o job.o lastcontainer.o loadavg.o log.o misc.o mount.o mountparser.o mounts.o plugin.o plugindata.o postmultiparser.o rebus.o request.o run.o session.o sessioncontainer.o sessionmanager.o sessionparser.o slog.o synchro.o system.o textstream.o threadmanager.o users.o
|
||||
|
||||
Executable
+167
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2012, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "job.h"
|
||||
#include "plugin.h"
|
||||
#include "log.h"
|
||||
|
||||
|
||||
|
||||
Job::Job()
|
||||
{
|
||||
jobs_queue_tab.resize(WINIX_JOBS_HOW_MANY_PRIORITIES);
|
||||
}
|
||||
|
||||
|
||||
void Job::CheckPriority(int & priority) const
|
||||
{
|
||||
if( priority < 0 )
|
||||
priority = 0;
|
||||
|
||||
if( priority >= WINIX_JOBS_HOW_MANY_PRIORITIES )
|
||||
priority = WINIX_JOBS_HOW_MANY_PRIORITIES - 1;
|
||||
}
|
||||
|
||||
|
||||
// first thread (objects locked)
|
||||
void Job::Add(PT::Space & job, int priority)
|
||||
{
|
||||
CheckPriority(priority);
|
||||
jobs_queue_tab[priority].push(job);
|
||||
WakeUpThread();
|
||||
}
|
||||
|
||||
|
||||
|
||||
size_t Job::Size(int priority) const
|
||||
{
|
||||
CheckPriority(priority);
|
||||
return jobs_queue_tab[priority].size();
|
||||
}
|
||||
|
||||
|
||||
|
||||
size_t Job::Size() const
|
||||
{
|
||||
size_t sum = 0;
|
||||
|
||||
for(size_t i=0 ; i<WINIX_JOBS_HOW_MANY_PRIORITIES ; ++i)
|
||||
sum += Size(i);
|
||||
|
||||
return sum;
|
||||
}
|
||||
|
||||
|
||||
bool Job::Empty(int priority) const
|
||||
{
|
||||
CheckPriority(priority);
|
||||
return jobs_queue_tab[priority].empty();
|
||||
}
|
||||
|
||||
|
||||
bool Job::Empty() const
|
||||
{
|
||||
for(size_t i=0 ; i<WINIX_JOBS_HOW_MANY_PRIORITIES ; ++i)
|
||||
if( !Empty(i) )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
second thread
|
||||
*/
|
||||
|
||||
// second thread (objects locked)
|
||||
bool Job::SignalReceived()
|
||||
{
|
||||
return !Empty();
|
||||
}
|
||||
|
||||
|
||||
// second thread (objects not locked)
|
||||
void Job::Do()
|
||||
{
|
||||
size_t i = WINIX_JOBS_HOW_MANY_PRIORITIES;
|
||||
bool is_empty;
|
||||
|
||||
while( i-- > 0 && !IsExitSignal() )
|
||||
{
|
||||
do
|
||||
{
|
||||
Lock();
|
||||
is_empty = Empty(i);
|
||||
Unlock();
|
||||
|
||||
if( !is_empty )
|
||||
DoQueue(jobs_queue_tab[i]);
|
||||
}
|
||||
while( !is_empty && !IsExitSignal() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// second thread (objects not locked, jobs_queue is not empty)
|
||||
void Job::DoQueue(JobsQueue & jobs_queue)
|
||||
{
|
||||
bool is_empty;
|
||||
|
||||
do
|
||||
{
|
||||
Lock();
|
||||
// references will not be invalidated after insertion to jobs_queue
|
||||
// (jobs_queue is std::queue and it uses std::deque by default)
|
||||
PT::Space & job = jobs_queue.front();
|
||||
Unlock();
|
||||
|
||||
DoJob(job);
|
||||
|
||||
Lock();
|
||||
jobs_queue.pop();
|
||||
is_empty = jobs_queue.empty();
|
||||
Unlock();
|
||||
}
|
||||
while( !is_empty && !IsExitSignal() );
|
||||
}
|
||||
|
||||
|
||||
// second thread (objects not locked)
|
||||
void Job::DoJob(PT::Space & job)
|
||||
{
|
||||
try
|
||||
{
|
||||
// !! FIXME plugin.Call() can log messages
|
||||
// we need Lock/Unlock mechanism there
|
||||
PluginRes res = plugin.Call((Session*)0, WINIX_JOB, &job);
|
||||
|
||||
if( res.res_true == 0 )
|
||||
DoWinixJob(job);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// second thread (objects not locked)
|
||||
void Job::DoWinixJob(PT::Space & job)
|
||||
{
|
||||
Lock();
|
||||
//log << log1 << "standard winix job: " << job.Text(L"type") << logend;
|
||||
Unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Executable
+82
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2012, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfile_winix_core_jobs
|
||||
#define headerfile_winix_core_jobs
|
||||
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
#include "basethread.h"
|
||||
#include "confparser/space.h"
|
||||
|
||||
|
||||
|
||||
#define WINIX_JOBS_HOW_MANY_PRIORITIES 32
|
||||
|
||||
|
||||
|
||||
|
||||
class Job : public BaseThread
|
||||
{
|
||||
public:
|
||||
|
||||
Job();
|
||||
|
||||
/*
|
||||
add a new job to the queue
|
||||
priority: 0-31 (0 - the lowest priority, 31 - the highest priority)
|
||||
*/
|
||||
void Add(PT::Space & job, int priority = 0);
|
||||
|
||||
|
||||
/*
|
||||
queue size, and size of all jobs in any priority
|
||||
*/
|
||||
size_t Size(int priority) const;
|
||||
size_t Size() const;
|
||||
|
||||
|
||||
/*
|
||||
true if specified queue is empty
|
||||
or if all queues are empty
|
||||
*/
|
||||
bool Empty(int priority) const;
|
||||
bool Empty() const;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
typedef std::queue<PT::Space> JobsQueue;
|
||||
typedef std::vector<JobsQueue> JobsQueueTab;
|
||||
JobsQueueTab jobs_queue_tab;
|
||||
|
||||
void CheckPriority(int & priority) const;
|
||||
void SaveToFile();
|
||||
void ReadFromFile();
|
||||
|
||||
|
||||
/*
|
||||
second thread
|
||||
*/
|
||||
|
||||
// standard winix jobs
|
||||
// Image image;
|
||||
// sending emails
|
||||
// etc.
|
||||
|
||||
bool SignalReceived();
|
||||
void Do();
|
||||
void DoQueue(JobsQueue & jobs_queue);
|
||||
void DoJob(PT::Space & job);
|
||||
void DoWinixJob(PT::Space & job);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -228,6 +228,25 @@
|
||||
#define WINIX_BASE_URL_REDIRECT 31030
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
messages sent from other threads
|
||||
!! IMPROVE ME check if some above messages should be moved here
|
||||
*/
|
||||
|
||||
|
||||
// a job has to be done
|
||||
// this is sent from the other thread (without locking)
|
||||
// in p1 you have a pointer to PT::Space
|
||||
// session is null
|
||||
#define WINIX_JOB 31200
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// values from 4000 - 4099 reserved for 'thread' plugin
|
||||
// see plugins/thread/pluginmsg.h
|
||||
|
||||
|
||||
@@ -90,6 +90,10 @@ void System::Init()
|
||||
thread_manager.Add(&image);
|
||||
|
||||
crypt.SetConfig(config);
|
||||
|
||||
// SetSynchro will be called by ThreadManager itself
|
||||
// job.ReadFromFile();
|
||||
thread_manager.Add(&job);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#define headerfile_winix_core_system
|
||||
|
||||
#include <ctime>
|
||||
#include "job.h"
|
||||
#include "dirs.h"
|
||||
#include "mounts.h"
|
||||
#include "db/db.h"
|
||||
@@ -69,6 +70,10 @@ public:
|
||||
// thread management
|
||||
ThreadManager thread_manager;
|
||||
|
||||
// jobs
|
||||
Job job;
|
||||
|
||||
|
||||
void SetCur(Cur * pcur);
|
||||
void SetConfig(Config * pconfig);
|
||||
void SetDb(Db * pdb);
|
||||
|
||||
@@ -55,9 +55,13 @@ void ThreadManager::Add(BaseThread * pbase)
|
||||
|
||||
void ThreadManager::StartAll()
|
||||
{
|
||||
synchro->Lock();
|
||||
|
||||
for(size_t i=0 ; i<thread_tab.size() ; ++i)
|
||||
Start(i);
|
||||
|
||||
synchro->Unlock();
|
||||
|
||||
were_started = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user