Commit 781cefd8 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Ensure unpacked resources are marked "in-sync".

parent eeb34d09
......@@ -4214,6 +4214,9 @@ gridUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
gridP->uuid, CDI_UUID_SIZE, DATATYPE_UCHAR, context);
}
reshSetStatus(gridP->self, &gridOps,
reshGetStatus(gridP->self, &gridOps) & ~RESH_SYNC_BIT);
}
......
......@@ -342,6 +342,8 @@ int instituteUnpack(void *buf, int size, int *position, int originNamespace,
instituteID = ip->self;
xassert(!force_id || instituteID == targetID);
Free(name);
reshSetStatus(instituteID, &instituteOps,
reshGetStatus(instituteID, &instituteOps) & ~RESH_SYNC_BIT);
return instituteID;
}
......
......@@ -343,6 +343,8 @@ modelUnpack(void *buf, int size, int *position, int originNamespace, void *conte
Free(name);
xassert(!force_id
|| (mp->self == namespaceAdaptKey(tempbuf[0], originNamespace)));
reshSetStatus(mp->self, &modelOps,
reshGetStatus(mp->self, &modelOps) & ~RESH_SYNC_BIT);
return mp->self;
}
......
......@@ -643,7 +643,7 @@ void reshSetStatus ( cdiResH resH, const resOps * ops, int status )
namespaceTuple_t nspT;
listElem_t * listElem;
xassert(ops && (status & RESH_IN_USE_BIT));
xassert((ops != NULL) ^ !(status & RESH_IN_USE_BIT));
LIST_INIT(1);
......@@ -660,7 +660,7 @@ void reshSetStatus ( cdiResH resH, const resOps * ops, int status )
xassert ( resHList[nsp].resources );
listElem = resHList[nsp].resources + nspT.idx;
xassert ( listElem->res.v.ops == ops
xassert((!ops || (listElem->res.v.ops == ops))
&& (listElem->status & RESH_IN_USE_BIT) == (status & RESH_IN_USE_BIT));
listElem->status = status;
......
......@@ -81,7 +81,9 @@ int reshUnpackResources(char * unpackBuffer, int unpackBufferSize,
case RESH_DELETE:
serializeUnpack(unpackBuffer, unpackBufferSize, &unpackBufferPos,
&resH, 1, DATATYPE_INT, context);
reshDestroy(namespaceAdaptKey(resH, originNamespace));
resH = namespaceAdaptKey(resH, originNamespace);
reshDestroy(resH);
reshSetStatus(resH, NULL, RESH_UNUSED);
break;
default:
xabort("Invalid/unexpected serialization type %d or transfer error!",
......
......@@ -1565,6 +1565,9 @@ taxisUnpack(char * unpackBuffer, int unpackBufferSize, int * unpackBufferPos,
taxisP->longname = longname;
}
reshSetStatus(taxisP->self, &taxisOps,
reshGetStatus(taxisP->self, &taxisOps) & ~RESH_SYNC_BIT);
return taxisP->self;
}
......
......@@ -1527,6 +1527,8 @@ void vlistUnpack(char * buf, int size, int *position, int originNamespace,
vlistAttsUnpack(targetID, CDI_GLOBAL, buf, size, position, context);
for (int varID = 0; varID < nvars; varID++ )
vlistVarUnpack(targetID, buf, size, position, originNamespace, context);
reshSetStatus(targetID, &vlistOps,
reshGetStatus(targetID, &vlistOps) & ~RESH_SYNC_BIT);
}
......
......@@ -1594,6 +1594,8 @@ zaxisUnpack(char * unpackBuffer, int unpackBufferSize,
serializeUnpack(unpackBuffer, unpackBufferSize, unpackBufferPos,
zaxisP->uuid, CDI_UUID_SIZE, DATATYPE_UCHAR, context);
reshSetStatus(zaxisP->self, &zaxisOps,
reshGetStatus(zaxisP->self, &zaxisOps) & ~RESH_SYNC_BIT);
}
static void
......
Supports Markdown
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