Commit 841bb0f8 authored by Jim Fulton's avatar Jim Fulton

Modified so that C API setstate makes object temporarily

undeactivatable.
parent 29bc83ab
/* /*
$Id: cPersistence.c,v 1.14 1997/05/01 20:33:58 jim Exp $ $Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $
C Persistence Module C Persistence Module
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
*****************************************************************************/ *****************************************************************************/
static char *what_string = "$Id: cPersistence.c,v 1.14 1997/05/01 20:33:58 jim Exp $"; static char *what_string = "$Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $";
#include <time.h> #include <time.h>
#include "cPersistence.h" #include "cPersistence.h"
...@@ -475,6 +475,7 @@ static int ...@@ -475,6 +475,7 @@ static int
Per_setstate(self) Per_setstate(self)
cPersistentObject *self; cPersistentObject *self;
{ {
self->atime=(time_t)1; /* Mark this object as sticky */
if(self->state==GHOST_STATE && self->jar) if(self->state==GHOST_STATE && self->jar)
{ {
PyObject *r; PyObject *r;
...@@ -483,6 +484,7 @@ Per_setstate(self) ...@@ -483,6 +484,7 @@ Per_setstate(self)
UNLESS(r=callmethod1(self->jar,py_setstate,(PyObject*)self)) UNLESS(r=callmethod1(self->jar,py_setstate,(PyObject*)self))
{ {
self->state=GHOST_STATE; self->state=GHOST_STATE;
self->atime=time(NULL); /* Unmark as sticky */
return -1; return -1;
} }
Py_DECREF(r); Py_DECREF(r);
...@@ -931,7 +933,7 @@ void ...@@ -931,7 +933,7 @@ void
initcPersistence() initcPersistence()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.14 $"; char *rev="$Revision: 1.15 $";
PATimeType.ob_type=&PyType_Type; PATimeType.ob_type=&PyType_Type;
...@@ -958,6 +960,10 @@ initcPersistence() ...@@ -958,6 +960,10 @@ initcPersistence()
/**************************************************************************** /****************************************************************************
$Log: cPersistence.c,v $ $Log: cPersistence.c,v $
Revision 1.15 1997/06/06 19:04:40 jim
Modified so that C API setstate makes object temporarily
undeactivatable.
Revision 1.14 1997/05/01 20:33:58 jim Revision 1.14 1997/05/01 20:33:58 jim
I made (and restored) some optimizations. The effect is probably I made (and restored) some optimizations. The effect is probably
minor, but who knows. minor, but who knows.
......
/* /*
$Id: cPersistence.c,v 1.14 1997/05/01 20:33:58 jim Exp $ $Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $
C Persistence Module C Persistence Module
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
*****************************************************************************/ *****************************************************************************/
static char *what_string = "$Id: cPersistence.c,v 1.14 1997/05/01 20:33:58 jim Exp $"; static char *what_string = "$Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $";
#include <time.h> #include <time.h>
#include "cPersistence.h" #include "cPersistence.h"
...@@ -475,6 +475,7 @@ static int ...@@ -475,6 +475,7 @@ static int
Per_setstate(self) Per_setstate(self)
cPersistentObject *self; cPersistentObject *self;
{ {
self->atime=(time_t)1; /* Mark this object as sticky */
if(self->state==GHOST_STATE && self->jar) if(self->state==GHOST_STATE && self->jar)
{ {
PyObject *r; PyObject *r;
...@@ -483,6 +484,7 @@ Per_setstate(self) ...@@ -483,6 +484,7 @@ Per_setstate(self)
UNLESS(r=callmethod1(self->jar,py_setstate,(PyObject*)self)) UNLESS(r=callmethod1(self->jar,py_setstate,(PyObject*)self))
{ {
self->state=GHOST_STATE; self->state=GHOST_STATE;
self->atime=time(NULL); /* Unmark as sticky */
return -1; return -1;
} }
Py_DECREF(r); Py_DECREF(r);
...@@ -931,7 +933,7 @@ void ...@@ -931,7 +933,7 @@ void
initcPersistence() initcPersistence()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.14 $"; char *rev="$Revision: 1.15 $";
PATimeType.ob_type=&PyType_Type; PATimeType.ob_type=&PyType_Type;
...@@ -958,6 +960,10 @@ initcPersistence() ...@@ -958,6 +960,10 @@ initcPersistence()
/**************************************************************************** /****************************************************************************
$Log: cPersistence.c,v $ $Log: cPersistence.c,v $
Revision 1.15 1997/06/06 19:04:40 jim
Modified so that C API setstate makes object temporarily
undeactivatable.
Revision 1.14 1997/05/01 20:33:58 jim Revision 1.14 1997/05/01 20:33:58 jim
I made (and restored) some optimizations. The effect is probably I made (and restored) some optimizations. The effect is probably
minor, but who knows. minor, but who knows.
......
/* /*
$Id: cPersistence.c,v 1.14 1997/05/01 20:33:58 jim Exp $ $Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $
C Persistence Module C Persistence Module
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
*****************************************************************************/ *****************************************************************************/
static char *what_string = "$Id: cPersistence.c,v 1.14 1997/05/01 20:33:58 jim Exp $"; static char *what_string = "$Id: cPersistence.c,v 1.15 1997/06/06 19:04:40 jim Exp $";
#include <time.h> #include <time.h>
#include "cPersistence.h" #include "cPersistence.h"
...@@ -475,6 +475,7 @@ static int ...@@ -475,6 +475,7 @@ static int
Per_setstate(self) Per_setstate(self)
cPersistentObject *self; cPersistentObject *self;
{ {
self->atime=(time_t)1; /* Mark this object as sticky */
if(self->state==GHOST_STATE && self->jar) if(self->state==GHOST_STATE && self->jar)
{ {
PyObject *r; PyObject *r;
...@@ -483,6 +484,7 @@ Per_setstate(self) ...@@ -483,6 +484,7 @@ Per_setstate(self)
UNLESS(r=callmethod1(self->jar,py_setstate,(PyObject*)self)) UNLESS(r=callmethod1(self->jar,py_setstate,(PyObject*)self))
{ {
self->state=GHOST_STATE; self->state=GHOST_STATE;
self->atime=time(NULL); /* Unmark as sticky */
return -1; return -1;
} }
Py_DECREF(r); Py_DECREF(r);
...@@ -931,7 +933,7 @@ void ...@@ -931,7 +933,7 @@ void
initcPersistence() initcPersistence()
{ {
PyObject *m, *d; PyObject *m, *d;
char *rev="$Revision: 1.14 $"; char *rev="$Revision: 1.15 $";
PATimeType.ob_type=&PyType_Type; PATimeType.ob_type=&PyType_Type;
...@@ -958,6 +960,10 @@ initcPersistence() ...@@ -958,6 +960,10 @@ initcPersistence()
/**************************************************************************** /****************************************************************************
$Log: cPersistence.c,v $ $Log: cPersistence.c,v $
Revision 1.15 1997/06/06 19:04:40 jim
Modified so that C API setstate makes object temporarily
undeactivatable.
Revision 1.14 1997/05/01 20:33:58 jim Revision 1.14 1997/05/01 20:33:58 jim
I made (and restored) some optimizations. The effect is probably I made (and restored) some optimizations. The effect is probably
minor, but who knows. minor, but who knows.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment