Skip to content

Commit

Permalink
fix asyn write(#95)
Browse files Browse the repository at this point in the history
It was a bug introduced when adding the log of client info in
write access (a7d196e)
  • Loading branch information
xiaoqiangwang committed Feb 19, 2024
1 parent 77f09f5 commit 8e72a0c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions pcaspy/casdef.i
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ struct casClientInfo {
%immutable;
const char *user;
const char *host;
const casCtx *ctx;
};

class PV : public casPV {
Expand Down
4 changes: 2 additions & 2 deletions pcaspy/channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ bool Channel :: writeAccess() const

caStatus Channel :: write (const casCtx &ctx, const gdd &value)
{
casClientInfo client = {pUserName, pHostName};
casClientInfo client = {pUserName, pHostName, &ctx};
return pPv->write(client, value);
}

caStatus Channel :: writeNotify (const casCtx &ctx, const gdd &value)
{
casClientInfo client = {pUserName, pHostName};
casClientInfo client = {pUserName, pHostName, &ctx};
return pPv->writeNotify(client, value);
}
2 changes: 1 addition & 1 deletion pcaspy/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def writeNotify(self, context, value):
# do asynchronous only if PV supports
if self.info.asyn:
# register async write io
self.startAsyncWrite(context)
self.startAsyncWrite(context.ctx)
# call out driver
success = self.writeValue(context, value)
# if not successful, clean the async write io
Expand Down
1 change: 1 addition & 0 deletions pcaspy/pv.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class AsyncWriteIO : public casAsyncWriteIO {
struct casClientInfo {
const char *user;
const char *host;
const casCtx *ctx;
};

class PV : public casPV {
Expand Down

0 comments on commit 8e72a0c

Please sign in to comment.