1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

wrong file.. cslaves keep state (but don't do anything with it yet)

This commit is contained in:
psyc://psyced.org/~lynX 2011-05-23 13:15:40 +02:00
parent 7502990918
commit a363c6f255
2 changed files with 21 additions and 20 deletions

View file

@ -60,10 +60,6 @@ volatile mapping _costate, _cmemory;
volatile mapping ctemp, cunused;
#endif // }}}
#ifdef USE_SPYC
mapping _state; // an alternative to ifdef CONTEXT_STATE ?
#endif
#ifdef PERSISTENT_SLAVES
int revision; // persistent revision counter
#endif
@ -90,9 +86,6 @@ create() {
ctemp = ([ ]);
_cmemory = m_allocate(0, 2);
#endif // }}}
#ifdef USE_SPYC
_state = ([ ]);
#endif
::create();
}
@ -294,19 +287,6 @@ insert_member(source, origin) {
P3(("%O -> _routes = %O\n", ME, _routes))
}
#ifdef USE_SPYC
get_state() {
PT(("cstate for %O picked up by %O: %O\n", ME,
previous_object(), _state))
return _state;
}
commit_state() {
PT(("cstate for %O committed by %O: %O\n", ME,
previous_object(), _state))
_state = ([ ]);
}
#endif
// code duplicaton is faster than others
#ifdef CONTEXT_STATE // {{{
//

View file

@ -29,11 +29,16 @@ private int _revision = -1;
#endif
#ifdef CONTEXT_STATE
// cslaves should store their copy of state, so it shouldn't be volatile here
private volatile mapping cast_state;
private volatile mapping temp_state;
inherit NET_PATH "state";
#endif
#ifdef USE_SPYC
mapping _state; // should probably merge with ifdef CONTEXT_STATE..
#endif
private volatile mapping _members;
void create() {
@ -42,6 +47,9 @@ void create() {
unless(mappingp(cast_state)) cast_state = ([ ]);
unless(mappingp(temp_state)) temp_state = ([ ]);
#endif
#ifdef USE_SPYC
unless(mappingp(_state)) _state = ([ ]);
#endif
}
#ifdef PERSISTENT_SLAVES
@ -264,3 +272,16 @@ void Diminish(mixed source, string key, mixed value) {
}
#endif // }}}
#ifdef USE_SPYC
get_state() {
PT(("cstate for %O picked up by %O: %O\n", ME,
previous_object(), _state))
return _state;
}
commit_state() {
PT(("cstate for %O committed by %O: %O\n", ME,
previous_object(), _state))
_state = ([ ]);
}
#endif