Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
kpetersn
Linkam
Commits
d2fa461b
Commit
d2fa461b
authored
Jul 09, 2018
by
kpetersn
Browse files
Added locks around API calls, which doesn't solve the problem of the IOC crashing on SIGPWR signal
parent
45328f8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
LinkamApp/src/Linkam_T96.cpp
View file @
d2fa461b
...
...
@@ -73,7 +73,9 @@ asynStatus Linkam::connect(asynUser *pasynUser)
*/
// OpenComms only works for Windows-style numbering of COM ports
//commStatus_ = OpenComms(true, 1, 0);
this
->
lock
();
commStatus_
=
OpenCommsFromDevice
(
true
,
serialPort_
);
this
->
unlock
();
/* We found the controller and everything is OK. Signal to asynManager that we are connected. */
status
=
pasynManager
->
exceptionConnect
(
this
->
pasynUserSelf
);
...
...
@@ -97,7 +99,9 @@ asynStatus Linkam::disconnect(asynUser *pasynUser)
// OpenComms only works for Windows-style numbering of COM ports
//commStatus_ = OpenComms(false, 1, 0);
this
->
lock
();
commStatus_
=
OpenCommsFromDevice
(
false
,
serialPort_
);
this
->
unlock
();
/* We found the controller and everything is OK. Signal to asynManager that we are connected. */
status
=
pasynManager
->
exceptionDisconnect
(
this
->
pasynUserSelf
);
...
...
@@ -158,7 +162,9 @@ asynStatus Linkam::readTemperature(epicsFloat64 *value)
{
static
const
char
*
functionName
=
"readTemperature"
;
this
->
lock
();
*
value
=
GetValue
(
u32Heater1TempR
);
this
->
unlock
();
// There probably isn't a good reason to retain the temperature in a private variable;
// The value is already stored in the parameter library
temperatureRbv_
=
*
value
;
...
...
@@ -174,7 +180,9 @@ asynStatus Linkam::readRampLimit(epicsFloat64 *value)
{
static
const
char
*
functionName
=
"readRampLimit"
;
this
->
lock
();
*
value
=
GetValue
(
u32Heater1LimitRW
);
this
->
unlock
();
asynPrint
(
this
->
pasynUserSelf
,
ASYN_TRACEIO_DRIVER
,
"%s:%s, port %s, value = %lf
\n
"
,
...
...
@@ -187,7 +195,9 @@ asynStatus Linkam::readRampRate(epicsFloat64 *value)
{
static
const
char
*
functionName
=
"readRampRate"
;
this
->
lock
();
*
value
=
GetValue
(
u32Heater1RateRW
);
this
->
unlock
();
asynPrint
(
this
->
pasynUserSelf
,
ASYN_TRACEIO_DRIVER
,
"%s:%s, port %s, value = %lf
\n
"
,
...
...
@@ -200,7 +210,9 @@ asynStatus Linkam::readHeaterPower(epicsFloat64 *value)
{
static
const
char
*
functionName
=
"readHeaterPower"
;
this
->
lock
();
*
value
=
GetValue
(
u32Heater1PowerR
);
this
->
unlock
();
asynPrint
(
this
->
pasynUserSelf
,
ASYN_TRACEIO_DRIVER
,
"%s:%s, port %s, value = %lf
\n
"
,
...
...
@@ -263,8 +275,10 @@ asynStatus Linkam::setRampLimit(epicsFloat64 value)
*
* Returns true if set successfully, false otherwise.
*/
this
->
lock
();
//status = SetValue(u32Heater1LimitRW, (float) value);
status
=
SetValue
(
2
,
(
float
)
value
);
this
->
unlock
();
asynPrint
(
this
->
pasynUserSelf
,
ASYN_TRACEIO_DRIVER
,
"%s:%s, port %s, value = %lf
\n
"
,
...
...
@@ -278,8 +292,10 @@ asynStatus Linkam::setRampRate(epicsFloat64 value)
bool
status
;
static
const
char
*
functionName
=
"setRampRate"
;
this
->
lock
();
//status = SetValue(u32Heater1RateRW, (float) value);
status
=
SetValue
(
1
,
(
float
)
value
);
this
->
unlock
();
asynPrint
(
this
->
pasynUserSelf
,
ASYN_TRACEIO_DRIVER
,
"%s:%s, port %s, value = %lf
\n
"
,
...
...
@@ -328,7 +344,9 @@ asynStatus Linkam::setHeating(epicsInt32 value)
bool
status
;
static
const
char
*
functionName
=
"setHeating"
;
this
->
lock
();
status
=
StartHeating
((
value
==
1
)
?
true
:
false
);
this
->
unlock
();
asynPrint
(
this
->
pasynUserSelf
,
ASYN_TRACEIO_DRIVER
,
"%s:%s, port %s, value = %d
\n
"
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment