Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
9611abb0
Commit
9611abb0
authored
May 21, 2018
by
Pavel Vainerman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(IOControl): minor optimization
parent
2537309a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
IOController.h
include/IOController.h
+1
-0
IOController.cc
src/Processes/IOController.cc
+9
-5
No files found.
include/IOController.h
View file @
9611abb0
...
@@ -272,6 +272,7 @@ namespace uniset
...
@@ -272,6 +272,7 @@ namespace uniset
uniset
::
uniset_rwmutex
ioMutex
;
/*!< замок для блокирования совместного доступа к ioList */
uniset
::
uniset_rwmutex
ioMutex
;
/*!< замок для блокирования совместного доступа к ioList */
bool
isPingDBServer
;
// флаг связи с DBServer-ом
bool
isPingDBServer
;
// флаг связи с DBServer-ом
uniset
::
ObjectId
dbserverID
=
{
uniset
::
DefaultObjectId
};
std
::
mutex
loggingMutex
;
/*!< logging info mutex */
std
::
mutex
loggingMutex
;
/*!< logging info mutex */
...
...
src/Processes/IOController.cc
View file @
9611abb0
...
@@ -43,6 +43,9 @@ IOController::IOController(const string& name, const string& section):
...
@@ -43,6 +43,9 @@ IOController::IOController(const string& name, const string& section):
ioMutex
(
name
+
"_ioMutex"
),
ioMutex
(
name
+
"_ioMutex"
),
isPingDBServer
(
true
)
isPingDBServer
(
true
)
{
{
auto
conf
=
uniset_conf
();
if
(
conf
)
dbserverID
=
conf
->
getDBServer
();
}
}
IOController
::
IOController
(
ObjectId
id
)
:
IOController
::
IOController
(
ObjectId
id
)
:
...
@@ -50,6 +53,9 @@ IOController::IOController(ObjectId id):
...
@@ -50,6 +53,9 @@ IOController::IOController(ObjectId id):
ioMutex
(
string
(
uniset_conf
()
->
oind
->
getMapName
(
id
))
+
"_ioMutex"
),
ioMutex
(
string
(
uniset_conf
()
->
oind
->
getMapName
(
id
))
+
"_ioMutex"
),
isPingDBServer
(
true
)
isPingDBServer
(
true
)
{
{
auto
conf
=
uniset_conf
();
if
(
conf
)
dbserverID
=
conf
->
getDBServer
();
}
}
// ------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------
...
@@ -412,16 +418,14 @@ void IOController::logging( uniset::SensorMessage& sm )
...
@@ -412,16 +418,14 @@ void IOController::logging( uniset::SensorMessage& sm )
try
try
{
{
ObjectId
dbID
=
uniset_conf
()
->
getDBServer
();
// значит на этом узле нет DBServer-а
// значит на этом узле нет DBServer-а
if
(
dbID
==
uniset
::
DefaultObjectId
)
if
(
db
server
ID
==
uniset
::
DefaultObjectId
)
{
{
isPingDBServer
=
false
;
isPingDBServer
=
false
;
return
;
return
;
}
}
sm
.
consumer
=
dbID
;
sm
.
consumer
=
db
server
ID
;
TransportMessage
tm
(
std
::
move
(
sm
.
transport_msg
()));
TransportMessage
tm
(
std
::
move
(
sm
.
transport_msg
()));
ui
->
send
(
sm
.
consumer
,
std
::
move
(
tm
)
);
ui
->
send
(
sm
.
consumer
,
std
::
move
(
tm
)
);
isPingDBServer
=
true
;
isPingDBServer
=
true
;
...
@@ -439,7 +443,7 @@ void IOController::logging( uniset::SensorMessage& sm )
...
@@ -439,7 +443,7 @@ void IOController::logging( uniset::SensorMessage& sm )
void
IOController
::
dumpToDB
()
void
IOController
::
dumpToDB
()
{
{
// значит на этом узле нет DBServer-а
// значит на этом узле нет DBServer-а
if
(
uniset_conf
()
->
getDBServer
()
==
uniset
::
DefaultObjectId
)
if
(
dbserverID
==
uniset
::
DefaultObjectId
)
return
;
return
;
{
{
...
...
Write
Preview
Markdown
is supported
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